troubleshooting Question

Ways to minimize bugs in java code

Avatar of Rohit Bajaj
Rohit BajajFlag for India asked on
Java
1 Comment1 Solution133 ViewsLast Modified:
Hi,
I am a java developer
What are the coding practices you use to minimize the number of bugs.
I recently was working on a small project. Time was less due to deadline.
Although i logically coded many things..
And there were several functions to be written.
It was frustrating to check each and every function and test cases were also of many different categories...
So i tested some functions and skipped some. And this had me having a feeling of uncertainity when the time was near for final deployment.
As a coder should i test each and every testcase ? or at least category of testcases ?
or initially strive to make a running code that approaches the final one ?

Some coding practices that i have learn are
1) start writing the code in pseudocode format to ease the process
2) Good naming
3) Defensive coding -- Somehow also making sure they way you are thinking is the way it will turn out.
4) Started testing my code separately in small small blocks

Somethings that delayed my work are small things like -
1) I was getting some error and i figured out it was because i was using java 10. so i switched to java 8. But this happened long back. And i didnt bother to fix it permannetly..and again i got this error because what i did was just doing an export statement.
so ended up again searching for the reason for this error.
2) Any part of code that is less understood or less tested seems to be causing bugs.

Any ideas about good coding practices ways to avoid delay bugs etc...
Thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros