What procedure do you follow as a developer for testing and reducing mistakes?

Yashy used Ask the Experts™
hi guys,

We have an online platform that we launched. From time to time, our developer writes  code and displays the finished result as 'done'. However, we then realise that he hadn't tested the various possibilities and ends up having to go back and fix and test it.

So, my point is, do you guys follow some sort of Change forms or something which will permit you to follow some step by step procedure, that reduces these mistakes?

Thanks for helping
Merry Xmas
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You may want to look into PHPUnit.
Test driven development is not very common in PHP (as opposed to Ruby, for ex), but it can be done.

Please note that it's a different way of doing things, so it will take some time to adjust.

Here are some tutorials that might help: http://code.tutsplus.com/series/test-driven-php--net-27482

Most Valuable Expert 2011
Top Expert 2016
The concept of Test-Driven Development, with some hand-built examples is shown here:

And, of course, we have a list of things to avoid:

+1 for Dan's recommendation of PHPUnit.  In the great "unwashed world" of PHP, automated unit testing is not nearly common enough.  PHP is an old language, and it predates many of the modern principles of computer science.  But you would be hard-pressed to find a noteworthy PHP developer of any system who does not insist on unit testing.  The unit tests are always part of the development process these days.

Git, PHPUnit, etc., are very important.  There are numerous other tools and techniques.  For example, you can automate your source code repository so that when you commit a code set, the unit tests are automatically run.  

Here are some terms to Google and learn about.
Agile Methodologies
Class Inheritance
Design by Contract
Mock Objects
Dependency Injection
Code Coverage
Cyclomatic Complexity
Alexandre SimõesManager / Solutions Architect
Well, I agree with the above but, in my opinion, technology comes as an implementation detail to this problem.
You'll find all the tools mentioned above, plus plenty more that will help you asset and maintain you application integrity; both at a unit level as also as an E2E level.

The reality is that one hundred unit tests won't prevent you from having a feature implemented badly.

Now, the real problem relies on the acceptance criteria, and how you validate it.
What are those "various possibilities" specified?
Do you create the test scenarios along with the feature details?
Do you specify all the impacts a feature has on other components/systems?

Of course that, most of the times, who asks for the features doesn't have enough knowledge to address all these questions, but there should be and hierarchy and process in place that is the one responsible for creating the task and deliver it to the developer.
This process should include the Product Owner, Architect, TTL... whoever has the knowledge to produce the tasks not only with 2 lines of text but also including the acceptance criteria and some test scenarios.

Now, if you reach here, you should ask your developers to implement the feature and write tests that implement the test scenarios you wrote.

At this point, either the tests fail and you go back tou your developer with clear evidences, or the implementation failed an edge case that wasnt present in the acceptance criteria and is the feature owner's job to add the test scenario and go back to the developer to implement it.

Like this you build confidence between people and stop playing this blame and finger pointing game.
Everybody, with no exception, should be accountable and it should be clear to everyone, in the case of failure, who should pick the task and rework it.

Again, technology is an implementation detail.
Whatever Unit Testing framework is good enough, use the one you prefer, but also remember, Unit Testing doesn't prevent you from failing and doesn't guarantee the quality of a deliverable.
For real E2E web app testing I like Selenium and I prefer to have those tests coded instead of produced by the point and click browser add-in,


Guys, this is amazing stuff. Precisely the type of answers I was looking for.

Thank you again.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial