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

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan CraciunIT ConsultantCommented:
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

Ray PaseurCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alexandre SimõesManager / Solutions ArchitectCommented:
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,
YashyAuthor Commented:
Guys, this is amazing stuff. Precisely the type of answers I was looking for.

Thank you again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.