• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Learning process to write junit tests

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you like Head First, there is a Head First, Servlets & JSP book that covers it pretty well
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sindhuri krish
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.I see Effective Java is recommended more.
 
Sindhuri krish
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Junilu. I totally agree with you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic