This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes Learning process to write junit tests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Learning process to write junit tests " Watch "Learning process to write junit tests " New topic
Author

Learning process to write junit tests

Sindhuri krish
Greenhorn

Joined: Jun 11, 2013
Posts: 17
Hi

I am a tester with knowledge in basics of java concepts and programming.
So far have been using gui test automation tool selenium. So I have been using selenium api to test the web pages and functionality.

But from next week I am assigned to another team where I have to pair up with a senior Java programmer to write junit tests for his code and also write the functional automation tests(setting up framework by myself) for the project using javascipt etc as required. They have few junit tests in place. Apologies, I only managed to get these details from my non technical manager at the moment as my next team is quite busy with a release.

Now as I only know very basic Java, Please please help me how I can plan my learning process(junit-heard they use mockit,javascript etc) to meet the expectations from my new upcoming paired up role with programmer.Can some programmers tell me if I should be able to understand his Java code before writing junits?

I started improving my javascript knowledge with online tutorials but dont get head and tail of developing a javascript based framework.

Thanks so much in advance for help


Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2274
    
  28

First of all, if a senior developer is not writing his/her unit tests, there's something completely wrong with the company you working for. A developer who doesn't write unit tests should be a developer without a job.

I understand you don't have much control over this, and in fact, this might be a good opportunity for you to learn from a senior person. it will be a little difficult because when you run whitebox unit tests, you have to be able to understand the inner logic of the module being tested. That probably means that you will have to read this dev's code and understand it completely. If you are using a test driven development approach, you write the tests first based on the use cases. I have no idea what approach your dev is going to take. JUnit tests are usually written in Java. SO, either way you will need to write Java, and you might have to understand his code, or have a good understand of the requirements.

What do you need help with first? DO you need to learn JUnit tests? JUnit is not that hard. Basically, you put a test method in a test class and annotate it @Test annotation. The test method should run the test case. Here's the getting started guide for JUnit
Sindhuri krish
Greenhorn

Joined: Jun 11, 2013
Posts: 17
Thanks so much Jayesh.
I understand I should learn Java completely which is going to be timetaking

Could you please suggest some reliable books for this.When I searched for Headfirst Java(only 1.5 is available)

Thanks

Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2274
    
  28

That's a very broad question. There are a lot of things you can learn after you learn basic Java. Ordinarily, people learn JEE, starting with Servlets & JSP. However, since you a specific project that you are going into, I would find what stack of technologies is used by that project, and find a path to learn those technologies.

Sindhuri krish
Greenhorn

Joined: Jun 11, 2013
Posts: 17
Thanks for response

True. I need to learn advanced core Java well and then move to the below stack which they use

JEE -JSP and Servlets, Jersey,JaxB ,JMS

Can you suggest good books for advanced core Java please

Head First Java seems easy to read but they dont have Java6:-(
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2274
    
  28

If you like Head First, there is a Head First, Servlets & JSP book that covers it pretty well
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4446
    
    5

If you, a tester, are paired up with a developer, I would imagine the purpose of such a pairing was not be so much to have the tester write automated test code but rather for the tester to provide input to the developer so that appropriate higher-level tests can be written. The tester would provide insights from a user's point of view so that automated functional tests can be written (more black box in nature than white box). The developer should already have written unit test code that exercise the core design and data structures and demonstrate internal code quality.

If you want to learn about using JUnit effectively, that's fine but if I were you I would first get in touch with the developer that you're going to pair with and set some expectations along the lines I just mentioned. IMO, it would be unreasonable to expect you to write JUnit tests just because you're a tester, despite having little or no prior experience with JUnit. What you can contribute is your deeper knowledge and understanding of the requirements and your ability to formulate tests around scenarios that the developer might not have thought about as he was developing with a focus on internal quality. That is the best value that you can bring to the table with this type of pairing.


Junilu - [How to Ask Questions] [How to Answer Questions]
Sindhuri krish
Greenhorn

Joined: Jun 11, 2013
Posts: 17
Thanks.I see Effective Java is recommended more.
Sindhuri krish
Greenhorn

Joined: Jun 11, 2013
Posts: 17
Thanks Junilu. I totally agree with you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Learning process to write junit tests
 
Similar Threads
Agile Java: question for beginning Java developers (i.e. most of you here)
Java Team Lead - Atlanta, GA
What testing tool should i learn to getting job in software testing
Simulating Mouse Click on a Client Side Image Map