Testing driven development lazarus / 6-IDE-CodeTools ---------------------------------------------------------------------- ik · 2011-03-10 11:53 Many frameworks and IDE's today offer the ability to do test driven development, that is you first create a test and then a code that match it (please note that a unit test and tests at all does not indicate the lack of bugs but the lack of bugs in what we check in the way we check it). Further more, many languages today have DSL and BDD based testing suites in additional to test units such as fpTest and fpTest2. So the suggestion is to allow such "feature" in Lazarus, and to make it based on project management, so the test units and even DSL/BDD (when there will be some for Pascal/Lazarus) will be part of the project development and management. What do you think on this idea, and what exactly is required from Lazarus in order to add such feature ? ---------------------------------------------------------------------- Leledumbo · 2011-03-10 15:51 Quoteplease note that a unit test and tests at all does not indicate the lack of bugs but the lack of bugs in what we check in the way we check itAnd... what makes it different from the previous statement? In IT project management course I took, I was taught that way already. Tests are made before the construction begins and they're made by different persons from the coder. But it's not from programmer's point of view though. ---------------------------------------------------------------------- ik · 2011-03-11 10:07 Quote from: Leledumbo on March 10, 2011, 04:51:36 pmQuoteplease note that a unit test and tests at all does not indicate the lack of bugs but the lack of bugs in what we check in the way we check itAnd... what makes it different from the previous statement? In IT project management course I took, I was taught that way already. Tests are made before the construction begins and they're made by different persons from the coder. But it's not from programmer's point of view though. Today at Lazarus unit tests are completely different project, and many does not use unit tests in their projects at all, or write them after they wrote the code of their application. ---------------------------------------------------------------------- Leledumbo · 2011-03-11 11:35 Yes, of course. Because unit testing requires the tested unit already programmed. ---------------------------------------------------------------------- Martin_fr · 2011-03-11 12:26 Quote from: Leledumbo on March 11, 2011, 12:35:57 pmYes, of course. Because unit testing requires the tested unit already programmed. Not necessarily. It requires the interface to be finished (and empty method to be generated). Then unit tests should compile, and you one can start writing code, until te tests no longer fail. Quote from: ik on March 11, 2011, 11:07:58 amToday at Lazarus unit tests are completely different project,That is only a convenience matter. And if you adapt other policies such as dividing business logic and representation, then it becomes even less of a matter. All business logic should/could be implemented outside the application, in it's own package. The package can be used by the tests, and since it is a package it can be open in the IDE while the test project is loaded. In fact it needs a project loaded, and since your app isn't written yet, the test is the prefect choice. Splitting large projects over several packages also improves speed. Less time spent waiting for compilation to finish, since you always only need to work on one package. Quote and many does not use unit tests in their projects at all, or write them after they wrote the code of their application. And you think they would do otherwise, if the IDE allowed them to have the test and the app open at the same time? ---------------------------------------------------------------------- ik · 2011-03-11 12:44 Quote from: Martin_frAnd you think they would do otherwise, if the IDE allowed them to have the test and the app open at the same time? If you have test driven development as a project, that is creating the tests as part of the application, it can help for more people to create tests imho. For example what if the tests will be created before the project itself and for every codetools/compiler problem of non existed code you will have the ability to add the structure and then write the code for both test and the actual code itself ?