Popular aspects used in TDD
- It defines simplicity as a key goal in the process of program designing and avoids unnecessary complexity. - Some examples of failure to follow Kiss are given by the function creep, scope creep and so on.
- This principle of software programming was coined by Kelly Johnson.
YAGNI:
- It stands for 'You Ain’t Gonna Need It'.
-This though being one of the primary principles of the extreme programming is followed in the test driven development also.
- According to this principle, the functionalities should not be added until they are very much required.
- In other words, it says that the functionalities should be implemented only when they are actually needed and not merely by what one foresees.
- This aspect has got a few drawbacks.
- The time required is obtained from the other processes like adding, testing, etc.
- It calls for the need of debugging and documentation of the new features.
- New features might impose certain constraints which can conflict with the working of a necessary feature in the future.
- The program may experience the code bloat i.e., it may get bigger and complex and thus complicated.
- A strict revision control is needed.
- Addition of more and more features may cause snow ball effect leading to the creeping featurism.
Fake it till you make it:
- This aspect boosts the real confidence of the developers, thus preventing them from getting stuck in to their self fulfilling prophecies.
- This technique can effectively combat the depression that most of the developers and programmers experience.
It is required that the tests are written first before the functionality is actually implemented. This step is known for having two benefits:
(a) It ensures that the application is worth testing i.e., it provides testability to the application. The application is considered to be tested via the outset by the developer and he/ she does not need to worry about testing later.
(b) It ensures that every feature and functionality has a unique test developed for it so that the functionalities are tested as the executable specifications.
2. First fail the test cases:
This step is carried out in order to ensure the correctness of the test and also its error detection ability. Once this is done, it becomes easy for the implementation of the functionality. This step is the essence of the test driven development. The following steps are constantly repeated: