How to simply understand TDD and DDT

TDD:TEST-DRIVEN Development

What exactly does test-driven development mean? How to understand Test Driven Development?

Here is a simple example of red and green bars:

1. Write test code

2. Compiling and running the test code will definitely fail, because the implementation code has not been written yet

3. Write the implementation code

4. Run the test to observe the test result, it may be red.

5. Develop and modify the code to make the test pass

6. Run the test and watch the test result until it turns green

7. Can be refactored, code optimized, redundancies removed, continue to run tests until green

 

DDT:DATA-DRIVEN TEST

What does data-driven testing mean? How to understand data-driven testing?

Data-driven automated testing is a testing method proposed for the above-mentioned tight coupling between development and testing. Establish a loosely coupled relationship between testing and development by establishing an association between testing and development-defined software metadata—metadata mapping table. No matter whether the tester modifies the test script or the developer modifies the software, only the metadata mapping table needs to be modified, which can satisfy the synchronization of testing and development. In this way, the workload of test script debugging can be reduced, and automated testing can be better realized

 

What is a data-driven automated testing framework?

A data-driven automated testing framework is a framework that reads input and output test data from a data file (such as an ODBC source file, Excel file, Csv file, ADO object file, etc.) In recorded or hand-written test scripts. Among other things, these variables are used as test data passed (input/output) to validate the application. In this process, the reading of the data file, the test status and all the test information are written into the test script; the test data is only contained in the data file, not in the script, and the test script is just a "driver", or A mechanism for transferring data.

 

KDT:KEYWORD-DRIVEN TEST

What does keyword-driven testing mean? How to understand keyword-driven testing?

The source of keyword-driven is very natural. Starting from the object-oriented idea, the same business logic will naturally be written as a class or function as a keyword to be called by different test scripts. When the test framework develops to the point where all the test processes can be combined with written functions and classes, it evolves to an advanced stage of keyword-driven, and the development of test cases becomes test data and keywords. , and simplifies the work of this combination into the familiar form-filling task of everyone, so as to finally achieve a data and keyword-driven overall test effect.

 

Reference document: http://blog.csdn.net/u010202588/article/details/38639811

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326632686&siteId=291194637
ddt
TDD