SPA Conference session: Test-Driven Spring/Hibernate Development | |||
| One-line description: | Taster of a 2-day course in TDD using jUnit and Canoo WebTest to develop a Web app based on Spring and Hibernate | ||
| Session format: | Long tutorial (330 mins) [read about the different session types] | ||
| Abstract: | Zuhlke has developed a training course in test-driven development, which uses jUnit and Canoo WebTest to develop a working Web application (a simple dating service). Detailed lab-notes are available. The course is built around six lab sessions, each of which adds part of a tier to the solution by first creating test cases for the new functionality and then developing the code to pass the tests. Test cases are written using jUnit for the inner layers, Canoo WebTest for testing the HTTP interfaces. In this tutorial, we allow delegates to sample three of the six modules, which should give them a taste of test-driven development using Java and the following technologies: * jUnit 4 * jMock 2.5 * Hibernate 3 (with HSQLDB) * Spring 2.5 * Ant 1.7 * Apache Tomcat 6 * Canoo WebTest 2.6 Lab 2 allows delegates who are new to TDD in Java to learn the basic tools and principles involved. Hibernate is introduced during this lab as a persistence mechanism. Lab 4 provides a taste of Spring as a web-based Model-View-Controller framework. Students will gain insights into the dependency injection mechanism and the configuration-file-based object collaboration wiring that Spring supports. Lab 4 also presents an example of using a mock object framework. Lab 6 introduces Canoo WebTest as a way to simulate a browser client and hence express the functional requirements of a Web application in the form of tests. It will be evident that test scripts in the form of XML documents are not ideal as a basis for discussing requirements with customers. | ||
| Audience background: | Basic knowledge of Java, HTML and HTTP would be a help. Anyone not familiar with Java but with similar object-oriented procedural language should be OK - the examples provided are fairly well pre-digested. | ||
| Benefits of participating: | By the end of the tutorial, delegates will have experienced test-driven development of a Spring/Hibernate Web application in the Eclipse environment (also using WebTest and Ant). They should thus have gained an understanding of the structure of a Spring/Hibernate application, appreciate some of the pitfalls, understand how to choose test cases that are comprehensive, orthogonal and independent, and above all, understand the test-driven mindset. They will have hands-on experience of at least one TDD toolset. | ||
| Materials provided: | Powerpoint introductory slides, lab notes. Memory sticks from which the entire development environment and pre-loaded lab exercises can be installed. Delegates should bring along some laptop computers (one between two is sufficient). | ||
| Process: | Following a quick introduction to the theory and practice of TDD, delegates work in pairs through each of the labs. Because each lab has a starting point and a model solution, students can work at their own pace and yet not be left behind when the next lab begins. We expect pairs to rotate between lab sessions. This will accommodate latecomers and spread knowledge and experience more widely. | ||
| Detailed timetable: | 13:00 Introductory slides and install development environment 13:30 Start Lab Session 2 14:30 Stop - wherever you got to - short retrospective 14:45 Break 15:00 Start Lab Session 4 16:30 Stop - wherever you got to - short retrospective 16:45 Break 17:00 Start Lab Session 6 18:30 Stop - wherever you got to - short retrospective 18:45 Questions and answers, a chance to complete unfinished labs 19:00 End | ||
| Outputs: | Delegates will be free to take the lab notes and the installed development environment away with them. However, we will not hand over the complete course materials, only those used in the session. After all, we want to leave some incentive for people to actually buy the course! However, we will give a voucher for a 20% discount off the full course fee to those attending this session (transferable to anyone within their organisation). | ||
| History: | First delivery. | ||
| Presenters | |||
| 1. Immo Hüneke Zuhlke Engineering Ltd |
2. Adam Shimali BSkyB |
3. | |