The invention discloses a test case generation method and device and a test case display method and device, and the test case generation method comprises the steps: obtaining a local demand document, extracting a keyword, a keyword condition and an expected result, and respectively placing into a case event table; positioning a module performance function method in the code document, obtaining a function method name and a function parameter, and respectively placing the function method name and the function parameter into a code document case table; extracting conditions of keywords from the use case event table, and determining random conditions in intervals larger than, smaller than and equal to the conditions of the keywords; aiming at the assignment of each group of function parameters, carrying out orthogonal sorting on random conditions of the keywords to obtain an orthogonal table object array; and screening out the test cases matched with the case expected result and in the orthogonal table object array to form a test case set. According to the technical scheme, the test case can be automatically generated, the test work efficiency can be improved, and the product online period can be shortened.