I have got several conferences for housekeeping unit tests in a project and I'm not sure which approach is going to be next to us. While reviewing the PHP project source code, I am trying to find the best conference to encourage easy development and accessibility of tests. I would be very interested in your experience / opinion:
- One folder for productive code, second for unit check: it separates unit testing from project logic files. Separating these concerns is a nuisance because it is an advantage: Anyone is viewing the source code of the project - I think - either browse the implementation or unit test (or more generally: Implementation only). The benefits of unit tests to have another approach to your classes have been lost - those two approaches are just like the IMO.
- Integrated Test Methods: Any modern unit test framework I know that developers are allowed to create dedicated test methods, annotate them ( @test ) and project them Embed in code. I see that the big drawback is that the project files have been ruined even if these methods are separated from a comment headline (like unit tests below this line), it is just unnecessary Blocks the class by form.
- Check files in the same folders as implementation files: Naming our file conferencing determines that PHP files containing sections (one square per file) are .class. Php . I can imagine that the unit testing about any class file ending in the class file .test.php must be presented more tests than other developers without the other classes. Although this project defames the folders, rather than the implementation files, this is my favorite yet, but I suspect: I would have thought that others have already thought about it, and for some reason abandon this option (I have not seen a java project with a folder foo.java and FooTest.java in the same folder.) Perhaps that's because Java Developer IDEs Make heavy use of , Which gives them easy access to tests, while there is no big editor in PHP (eclipse for Java) - many devices I know that VIM / MACAC or similar editors use PHP for the development of a lot Comes with less support.
What is your experience with any of these unit testing placements? Do you have another session that I have not listed here? Or am I overwriting access to unit tests for reviewers only?
I have different source files in the same directory as the output code (# 3)
Unit tests are not second class citizens, their code should be maintained and output code like recycled if you keep your unit test in a separate directory, then remember the next developer to change your development code. It is possible to have unit tests and make the test. Failure by.In C ++, I get three per square files:
MyClass.h myClass.cpp t_MyClass.cpp
if If you are using VIM, then my plug-in and unit test files can be useful to toggle between the source.
Comments
Post a Comment