First Pass Completed: Rough Draft TDD Demonstration Videos 131
As promised, I’ve made a complete sweep through a series of videos. You can find all of them: here.
These videos include several warts and false starts. Depending on the interest and feedback, I’ll redo these at some point in the future.
Question: Should I repeat this series in C#, or some other language? Some people have expressed interest in this. It’s probably 15 hours of work in C#, so I’d need to know it was worth the effort. What’s your opinion on that?
- Getting Started
- Adding Basic Operators
- Removing Duplication
- Extracting to Strategy
- Removing Duplication via Refactoring or Removing Duplication via Tdd using Mockito
- Introducing an Abstract Factory
- Adding a Sum operator
- Adding Prime Factors Operator
- Composing Operators and Programming the Calculator
- Using FitNesse to Program the Calculator
I’ve already received several comments both here on the blog as well as with the videos. I’ll keep track of those comments and incorporate the ones that fit for me.
Each video has a link on its page to download it. However, to download a video, you will have to create an account and log in. So here are the links, these won’t work without first creating an account (I’ll update original blog with these as well):- Getting Started Download
- Adding Basic Ops Download
- Removing Duplication Download
- Extracting to Strategy
- Removing Dups/Refactoring Download
- Removing Dups/Tdd Download
- Abstract Factory Download
- Sum Operator Download
- Prime Factors Download
- Composing Math Operators Download
- Using FitNesse Download
Using Band XI's FitNesse Plugin for Eclipse 26
Our friends at Band XI have an Eclipse plugin for FitNesse. I spent a few hours trying it out for a client. Here are some notes to help you use it.
Band XI’s plugin makes it easy to run FitNesse from within Eclipse and to edit the Java code and FitNesse pages in one place. Hence, no more switching between windows while you’re making your acceptance tests pass.
The download and installation page describes how to get started. While it only lists support for Eclipse 3.1 and 3.2, it seems to work fine in Eclipse 3.3 and 3.4 M7.
After you have installed the plugin, you will have two new toolbar buttons, one to start and stop a local FitNesse server and one to start and stop a remote server.
You configure where these servers are located in the Preferences > FitNesse page. These settings apply for the whole workspace. It might be nice to be able to configure them on a project by project basis, but that’s not supported (and maybe not that important, either).
You also get a new project option in the “New” wizard. Java > FitNesse > FitNesse Example Project creates a new Java project with src, FitNesseRoot and fixtures source directories. The include all the standard example acceptance tests and code that comes with the FitNesse download.
I encountered a little oddity the first time I started the local server by clicking the toolbar button. The usual front page, with links for the examples, manual, etc. weren’t shown on the FitNesse front page.
I determined that this happens because the default FitNesseRoot in the preferences is ”.”. Instead, start the server the first time by right-clicking on the FitNesseRoot folder, then select the FitNesse menu and the Launch FitNesse runtime on this root folder option. From then on, it will launch with this folder as the default, until you select a different one.
Using your own FitNesse installation and projects
Here’s what I did to work with existing projects and use a separate FitNesse installation outside of an Eclipse project.
If you have another project with the FitNesseRoot folder, you can use it as just described (i.e., using the context menu).
Otherwise, go to the Preferences > FitNesse page and paste the full path of your alternative FitNesseRoot in the “local root directory” field. Be sure to delete the ”.” value that is present by default and also watch for spaces before and after the string. It appears that they aren’t removed, causing mysterious behavior…
To build fixtures in your Java project, add the FIT_LIB and FITNESSE_LIB “variables” (defined by the plugin) to the Java build path for your project (using the project properties dialog). The default values of these environment variables should be fine unless you are running a different version of FIT or FitNesse in your separate installation (in which case you can change the values as needed).
Finally, set your class path in your FitNesse pages to point to the correct directory for the compiled classes. For example,
!path /home/me/projects/workspace/MyFitProject/bin
That should do it!