This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Testing and the fly likes debugging vs testing and ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "debugging vs testing and ..." Watch "debugging vs testing and ..." New topic
Author

debugging vs testing and ...

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Hey all.
what is the diff btw debugging and testing ?
what is the profiling ? and what is tunning ?
thanks.
[ August 11, 2004: Message edited by: John Todd ]
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 762
Originally posted by John Todd:
what is the diff btw debugging and testing ?
what is the profiling ? and what is tunning ?


Debugging is the attempt to remove defects. Testing is the attempt to uncover defects.

Profiling is analyzing an application for execution characteristics (e.g. speed, memory usage). Tuning is improving an application's execution characteristics.

-j-
[ August 11, 2004: Message edited by: Jeff Langr ]

Books: Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
J. B. Rainsberger
author
Ranch Hand

Joined: Aug 05, 2004
Posts: 87
Debugging is the art of guessing where the problem is, groping in the dark to find it, then guessing how to fix it.

Testing is the art of simply saying what the code ought to do, then verifying that it does those things correctly.

Tuning is about changing a system's configuration parameters, usually to improve performance.


Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394230/ref=jranch-20" target="_blank" rel="nofollow">JUnit Recipes: Practical Methods for Programmer Testing</a>
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
FYI: Regarding performance, JUnitPerf is a collection of JUnit test decorators used to measure the performance and scalability of functionality contained within existing JUnit tests.

If you're interested you can find out more here:
http://www.clarkware.com/software/JUnitPerf.html

I really liked Dave Thomas and Andy Hunt's book "Pragmatic Unit Testing" for explaining why you should Unit Test and how it's useful. I look forward to checking out the JUnit Recipes book to see examples of best practices. I'm not sure if I haven't either gotten carried away with too many needless test cases or neglectful with too few in the code I've written where I've incorporated JUnit.


Greg Ostravich - SCPJ2
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Why Use JUnitPerf?


JUnitPerf tests transparently decorate existing JUnit tests. This decoration-based design allows performance testing to be dynamically added to an existing JUnit test without affecting the use of the JUnit test independent of its performance. By decorating existing JUnit tests, it's quick and easy to compose a set of performance tests into a performance test suite. The performance test suite can then be run automatically and independent of your other JUnit tests. In fact, you generally want to avoid grouping your JUnitPerf tests with your other JUnit tests so that you can run the test suites independently and at different frequencies. Long-running performance tests will slow you down and undoubtedly tempt you to abandon unit testing altogether, so try to schedule them to run at times when they won't interfere with your refactoring pace.

JUnitPerf tests are intended to be used specifically in situations where you have quantitative performance and/or scalability requirements that you'd like to keep in check while refactoring code. For example, you might write a JUnitPerf test to ensure that refactoring an algorithm didn't incur undesirable performance overhead in a performance-critical code section. You might also write a JUnitPerf test to ensure that refactoring a resource pool didn't adversely affect the scalability of the pool under load.

It's important to maintain a pragmatic approach when writing JUnitPerf tests to maximize the return on your testing investment. Traditional performance profiling tools and techniques should be employed first to identify which areas of code exhibit the highest potential for performance and scalability problems. JUnitPerf tests can then be written to automatically test and check that requirements are being met now and in the future.

Here's an example usage scenario:

You've built a well-factored chunk of software, complete with the necessary suite of JUnit tests to validate the software. At this point in the process you've gained as much knowledge about the design as possible.

You then use a performance profiling tool to isolate where the software is spending most of its time. Based on your knowledge of the design you're better equipped to make realistic estimates of the desired performance and scalability. And, since your refactorings have formed clear and succinct methods, your profiler is able to point you towards smaller sections of code to tune.

You then write a JUnitPerf test with the desired performance and scalability tolerances for the code to be tuned. Without making any changes to the code, the JUnitPerf test should fail, proving that the test is written properly. You then make the tuning changes in small steps.

After each step you compile and rerun the JUnitPerf test. If you've improved performance to the expected degree, the test passes. If you haven't improved performance to the expected degree, the test fails and you continue the tuning process until the test passes. In the future, when the code is again refactored, you re-run the test. If the test fails, the previously defined performance limits have been exceeded, so you back out the change and continue refactoring until the test passes.




It's good tutorial....

I'm trying to use this tool.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
what is the diff btw debugging and testing ?


In my opinion,

- Debugging is some phase will occur AFTER coding complete.
Debuging phase is find some bug/defect in some process.

- Testing , can separate to Unit Testing, Integration Testing
Testing phase can do in Coding phase and AFTER coding completed.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by somkiat puisungnoen:
- Debugging is some phase will occur AFTER coding complete.
Debuging phase is find some bug/defect in some process.

- Testing , can separate to Unit Testing, Integration Testing
Testing phase can do in Coding phase and AFTER coding completed.

Debugging as in using the debugger may happen during development as well as after testing has found a defect.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
wood burning stoves
 
subject: debugging vs testing and ...
 
Similar Threads
How to debug a swing GUI in Eclipse
Implement or not implement the logging?
Assertion
Project Management
To authors: jsf unit test