Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm having a hard time making the connection between testing and code. I could ask numerous questions here about things like directory structure and naming of test classes and JUnit 3 vs 4 and so on, but I'd rather find a sample project that does it right and learn by reading it.
I'd like something not too complex so that I can understand it easily, and JUnit 4 would be best (no reason to stick with 3 since I'm starting fresh, right?). I'm on Windows 7, I use Eclipse and I'm planning/hoping to learn and use Hudson. I like Ant, haven't had a good experience with Maven but that's cool too.
Is there a sample project out there that fits this criteria?
edit: Neither of these answers mentioned Hudson; I really like the Craftsman articles (and maybe it goes into continuous integration) but does anyone else have any other suggestions?
I found the Craftsman articles by Robert Martin (Uncle Bob) an excellent resource for learning effective unit testing. It focuses on Test Driven Development and walks you through the experience of a new coder learning how to test code. The first article can be found here and is called The Craftsman #1: Opening Disaster.
If you're looking for an easy example of project structure and convention, I would recommend giving Maven another go. To use it with Eclipse, install the M2Eclipse plugin, and create a Maven project using one of the Maven archetypes. The archetypes build simple template projects, including source and test structure, and will run with Maven and Eclipse right away.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am currently working on a Java project with "IBM Rational Software Architect"(Licensed Version) as an IDE .My task is to understand the code flow and need to prepare Technical Document as the project is very big (a lot of codes, classes, packages, etc) and undocumented. Since, the project is written in Java, my idea was to reverse engineer this project to see its architecture in UML. Do suggest me any open source software/ plugin that suits my IDE and can complete the task very easily?
I googled and found many useful Tools for Eclipse IDE but not for IBM Rational Software Architect.
Thanks for your answer !!
StarUML is a good open source tool, I think it have what you desire.
You should consider stand-alone products. For generating sequence diagrams and jar dependencies dynamically try jSonde
Static code analysis will suit for class diagrams - any modern IDE (like IntelliJ IDEA) can generate it
You can try "Modelio" which is Open Source and can reverse and generate class diagram.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I would like to know about good tools to automatically generate JUnit4 tests. By automatic generation, I mean that if I write a .java file, then a test file for the same should be created with method placeholders and setup/teardown in place (like the auto-generate constructors feature of eclipse)
I found some but I haven't tried them all and frankly I am overwhelmed by the plethora of choices. I was wondering if someone has tried some/all of them and has any recommendations from these or any other.
http://moreunit.sourceforge.net/
http://sourceforge.net/projects/junitgenerator/
http://sourceforge.net/projects/junittestmaker/
http://jub.sourceforge.net/
http://testcasegen.sourceforge.net/
http://www.softpedia.com/get/Programming/Other-Programming-Files/JUnit-Test-Generator.shtml
http://mediakey.dk/~cc/generate-junit-tests/
http://developers.google.com/java-dev-tools/codepro/doc/features/junit/test_case_generation?hl=hu-HU
http://agile.csc.ncsu.edu/SEMaterials/tutorials/fit/
I use the Eclipse plugin MoreUnit. It can generate TestClasses and test-methods. It also shows which methods have test methods ...
Together with TestNG(JUnit is also good) and EclEmma junit testing is quite easy to handle and keep track on the code coverage
Some suggestions: Randoop, AgitarOne, and EvoSuit for Java.
The Squaretest plugin for IntelliJ IDEA works well. It can auto-generate test-classes with a lot of the required boilerplate code. It supports creating tests in either Java or Groovy with the JUnit4, JUnit5, AndroidJUnit4 or Robolectric3 test frameworks.
Disclaimer: I created the Squaretest plugin.
CodePro Analytix Plugin for Eclipse is also good. Exiting thing for me is it generates multipe testcases covering all the execution paths of a method, analyses dead code and dependencies and has lot of other features.
Check out the User Guide here
My favorite is JUnit-Tools to generate JUnit Tests and more. It's a eclipse plug-in and up to date. Further there are many possibilities to configure and to adapt.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Can someone provide useful links regarding "nesting of projects",i am asking this question specifcally in context of java/eclipse.
Since Milestone 5 of version 4.5, Eclipse IDE supports nested/hierarchical view of projects: https://www.eclipse.org/eclipse/news/4.5/M5/
In context of eclipse it means that you create a new project and try to create a new project within the first project. As far as I know that's not possible. Check Top Ten Architectural Problems in Eclipse for further information.
As schlingel already said, eclipse can't handle nested project. Generally nested projects represent subprojects or modules of a bigger project and they often inherit settings while the base project might manage the nested ones.
Using Maven and the m2eclipse plugin you might get support for nested projects to some extend. The filesystem representation would be nested, however eclipse can't display that as such. In eclipse they'd look like parallel projects, but the m2eclipse plugin has some support to at least provide some functionality nesting would provide.
One way of grouping projects visually in eclipse are working sets. However, note that working set structure is visual presentation only, it does not create nested projects and it does not effect directory structure (just as schlingel and Thomas said).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I need good examples of Junit tests for Java classes, to spend in training, anyone have suggestions of good examples?
Here is a good one which shows you step by step what you have to do, including screenshots with Eclipse also.
From memory, I think Kent Beck's Test Driven Development walks through some good examples. Probably a good book to refer to in testing training courses. http://www.amazon.co.uk/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530
You can have a look at open source software - maybe a library which you use for yourself. They often contain unit tests, e.g.:
Apache Commons lang test code
Google guava libraries test code
and for sure a lot more....
I do not know what you mean with 'to spend in training' but if you will use it for other purpose than to train yourself check the license first.
JUnit tests are somehow based on your procedures. It depends what do you want to test. For example, if you want to test if for specific input, you receive specific output, you can use assertEquals. For writing a simple step by step JUnit test in Java in Eclipse, look at "Write Simple JUnit Test".
For thorough information, look at "Unit Test Tutorials".
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Our project will integrate mutation testing as part of its build cycle. Right now, we are on the evaluation phase.
So far, I have only found that Jester has a maven-plugin (Grester). I have not been able to find anything for the other mutation testing tools available (Jumble, µJava and Javalanche). Of course, we want full maven integration. We do not want to reinvent the wheel (i.e., write our own maven plugin for the tool that we choose).
Do you know of any maven-plugins for those Jumble, µJava and Javalanche? I've already googled and, like I said, have only found Grester. Also, if you know of any other mutation testing tools for java, any hints will be greatly appreciated.
PIT, provides a Maven plugin.
It's available from Maven central and has the advantage of being considerably faster than Jester, Jumble or muJava. It is also actively developed and supported which does not seem to be the case for Jester or muJava.
(disclosure I'm the author and am probably unfairly biased)
Of the mutation testing tools in the java world, I've found this about Maven support:
µJava: no
Bacterio: no (uses its own ide)
Javalanche: no (uses its own ide)
muTest (µTest): no
Jumble: yes
PIT: yes
Jester: yes
Simple Jester: no
Judy: no
MAJOR: no (uses its own compiler)
(This information was found by googling and from the article Delahaye, du Bousquet: A Comparison of Mutation Analysis Tools for Java.)
My vote would also go for PIT.