unit testing - TDD - One test at a time or make a batch? -
for unit tests;
Write a test Write code to pass it. Refactor.
or
Write all known tests. Make a pass refactor.
I ask this because TDD has said that you stop writing the code after all the tests but this point is unclear.
Edit
One thing I think is that TDD is focused on more for this "rule" in relation to the stories / functions? Do anyone agree?
A few months later
After watching a skycast, I have fixed one (I will try and find the link) on the topic as follows.
- Write the test / behavior / functionality name at the top of the test class.
- Cut and paste the test name
- Complete the exam.
- Repeat until the list is empty.
Using the example # C, however, should be normal.
// login page should not allow empty password // Cut / paste will be removed on it // login page should not allow empty user name ... [TestFixture ] Class loginpages tests {{test} public login_page_should_not_allow_blank_password () {// test code ...}}
- Write a test failure only for the test, usually because it does not compile your code
- l This is the TDD rules. This means that you are only writing a unit test and a bit of code at the same time and it is weak. are doing.
Point of TDD is not typing, it is using your test to get out of the design. The idea is that all your tests are close once and cover all the functionality you know that your code is also full. Without testing, when will you do when you are done, so, when you feel that you have tested everything, then stop it.
Comments
Post a Comment