Home Contact

PD Versus-inspired Logophilduba.com

Adventures in Web Application Develompent by Phil Duba

Recent Entries

Popular Entries

Top Commenters

  • Nathan Mische (11)
  • CFdevfusion (6)
  • CFFusionDev (5)
  • Peter Bell (4)
  • Sean Corfield (3)
  • Rey Bango (3)
  • Terrence Ryan (3)
  • Scott (2)
  • Jim Priest (2)
  • David (2)

Slideshows

Pool Surprises...

Sponsored Links

Text Link Ads

CFUnited: Continuous Integration with SVN, ANT, CFUnit & Selenium

Posted On June 25, 2008 10:53 AM By Phil in CFUnited

Next up on Saturday was Qasim Rasheed's presentation on integrating SVN, ANT, CFUnit & Selenium. Some of the beginning stuff was covered in other sessions, but one thing I did notice is that everyone does their things slightly differently even if they are using the same products. Also, Qasim indicated if he had more time, he'd probably have looked at MXUnit as opposed to CFUnit, but reiterated what others said and that any of the xUnit frameworks should be used. His overview of Selenium was very good and I'll add that to my ever growing list of things to try out after the conference and bring into the workplace for use. Here are my notes and conclusions from this session:

Continuous Integration
- members of team integrate their work frequently
- not just technical but also a cultural adaptation/conversion - the latter is probably harder since the former can be done cheaply

Principles
- maintain single repository - including documentation
- automate build process and make it self testing - can give build files to new developers so they can get up to speed on process quickly
- daily commits
- schedule the integration process on a CI server
- keep build fast
- notification on build and reporting on what was built
- automate the deployment aspect

CI - Benefits
- reduces risks and assumptions (particularly through unit testing)
- reduce manual processes, particular those that are repetitive
- higher product confidence by reducing delivered bug (more commits and unit testing = finding bugs quicker)
- better project visibility - can announce builds more frequently, might even be able to be shown earlier, increasing customer relationship (very Agile like in wording)
- nice quote "Assumption is the mother of all screw ups"

Source Control Management - Why?
- "undo button" for work environment - interesting perspective
- stabilizing work environment
- auditing/status accounting
- good foundation for a SCM plan

Source Control Management - Fundamentals
- Lock-Modify-Unlock (one at a time) or Copy-Modify-Merge (CVS, SVN, GIT)
- working copy - sandbox of local copy of files from repository/central store of data at a particular point of time

Source Control Management - Subversion
- Atomic commits (all or nothing)
- Efficient handling of binary files
- Stable/Good Security/Low admin overhead


Subversion - Work Cycle
- initial checkout
- update working copy
- modify working ocpy
- examine modifications
- commit changes
- if confilcts
    - update working copy
    - resolve (merge)
    - re-do commit
- project
    - trunk - main
    - branches
    - tags

ANT (Another Neat Tool) - Intro
- high level overview, covered similar information as ANT presentation
- bundled within Eclipse
- recommends having a <description> tag under Project, mostly for documentation
- each target is only run once regardless of how many times it may be in the depend (i think) tag
- can make the target private using "-" as a prefix, i.e. -init, this prevents it being run from the command line

Unit Testing
- procedure to validate individual units of code
- testing against contract
- require investment in time initially, but will save time eventually, particularly in changes
- unit test establishes some artificial environment and then invoke routines in the module being tested (mocks)
- Benefits
    - simplifies integration
    - saves time eventually (part of ramp-up)
    - can highlight design flaws - easier to write, the better the design
    - facilitates change - allows more confidence when making changes

Selenium - Functional Testing Tool
- open source for testing web applications
- from ThoughtWorks
- runs within browser as it is JavaScript based
- Regression testing of existing Web UI
- reports bugs simulating user action in the browsers

How to User it
- Record mode: Selenium IDE - best tool to use, probably where to start
- Bot mode: Selenium Core - scripts
- Driven mode: Selenium Remote Control - good for writing test cases in other languages, almost proxy like
- Selenium Grid: multiple tests on multiple machines - can distribute among different servers/machines

Selenium IDE
- Firefox extension
- Complete IDE allowing for record, edit and debug test case
- Intelligent field selection

Selenium Core
- core tests run directly in browser, written in JavaScript/DHTML
- need to copy tests directly into the application web server uses JS & iFrames to embed a test automation in browser

Selenium Core Concepts
- commands - tell selenium what to do, each is one line in a table - command|target|value
- Actions - where test actually do something
- Accessors - state of application and store variables to use later
- Assertions - verify the state conforms to what is expected (same as applied in unit testing)
- Element Locators
    - Tells Selenium which HTML element a command refers to
    - Firefox XPath Extension and Firebug to locate the elements

- great demo of walking through dev -> test -> production

The more I think of our setup at work, the more I think we need greater separation. By that I mean, right now we have essentially our projects at the web root level. For ease of use with SVN (or even CVS), we need to think of more segregation of projects. There a number of projects we've thought about doing to lessen our repetitive development tasks, so this may be a good time to look at these projects so each has their own repository and we can control more of the build and deploy process to automate changes and lessen manual tasks of ftp'ing individual files over. This would probably help both our CF and Java projects.

Comments

Qasim Rasheed's Gravatar Phil

Thanks for a nice review. You can download the code and presentation from my website at

http://qasimrasheed.com/blog/index.cfm/2008/6/29/C...

Thanks
# By Qasim Rasheed | 6/29/08 9:52 PM
Post Your Comments

Captcha

If you subscribe, any new posts to this thread will be sent to your email address.