"Agile Development with Ruby" course at Vilnius University
Posted by Saulius Grigaitis
When I was student, I always thought that it would be great to have more specific courses. Yep, I still agree that students should build strong fundamentals at university, instead of learning something very specific, so they can build specific knowledge later on top of learned fundamentals. But it’s fun to learn some trending topics that people are talking about now. Ruby and Agile are still trending topics here in Lithuania, and since I’m one of Lithuanian Ruby pioneers I decided to deliver course, which embraces two most important things in my daily development – Agile and Ruby. I delivered “Agile Development with Ruby” last semester at Vilnilus Univesity, The Faculty of Mathematics and Informatics. It was my first delivered course, so I decided to share my experience here and get some feedback from people who delivered or listen to such courses or take classes on similar topics.
My main goal was to teach students how to do BDD (Behaviour Driven Development), so I wanted to share knowledge that our team has gained during 3 years of BDD practice developing real-world apps using Ruby on Rails/Merb. My course contains main things that our team utilizes in day-to-day work:- Ruby
- RSpec
- Cucumber
- Mocha
- Rails
- Factories
- Intro (general info about course + live BDD example)
- Ruby.new, Classes, Objects, and Variables, Containers, Blocks, and Iterators
- Standard Types
- More About Methods
- Expressions
- Introducing first task + live example how to complete that task
- Exceptions, Catch, and Throw, Modules
- BDD with RSpec
- RSpec and RSpec-Rails matchers
- Stubing/Mocking using Mocha (examples), ActiveRecord::Base, ActiveRecord::Validations
- Introducing second task + live example how to complete that task, ActiveRecord::Associations::ClassMethods
- Filling DB with test data: Fixtures, Blueprints, Hornsby, Faker
- Rails Architecture, Writting Controllers Specs, Testing controllers with RSpec, ActionController::Base, ActionController::Routing
- ActionView::Base, Writting Views Specs
I decided to go with live code writing and source code analysis together with documentation – combination I use in my daily development, instead of boring slides. I used slides only for a couple of lectures that were more about ideology, like “BDD with RSpec”. It went very well, because writing code live, solving unexpected issues and duscussions involve students much more than boring slides.
All students picked unique topic for their tasks (like “DVD Store” or “Funds Trading System”). Then they got 3 practical excercises:- Implement simple CLI application (5 or more models, at least 50 specs, can’t use Rails, 3rd party ORMs or any other 3rd party frameworks, 2 custom matchers, etc…)
- Refactor models to ActiveRecord (AR’s validations, associations etc., testing data loaders, stubs/mocks etc. )
- Refactor to Ruby on Rails app (at least one complete CRUD, at least 10 controller specs, at least 5 views specs, stubs/mocks etc. )
The scope of practical tasks was just too big for most of the students. Most of them completed first task, but only few completed all of them, so I needed to simplify it somehow. I’d leave same task set for those students who want to get highest marks, but for others scope should not be so big. I already tried to do that, but I can’t find any better solution. I don’t think that implementing some math algorithm (like fibonacci sequence) makes sense, because such task really doesn’t show benefits of BDD. I believe that doing BDD for “business logic” is the best way to learn BDD. So one idea that comes to my mind is just make lower measurable requirements, like 3 models instead of 5, or 30 specs instead of 50.
Has anybody have any ideas regarding questions that I’m still looking answers for:- How to make smaller scope of practical tasks and still make tasks that best fit learning BDD ?
- Usually I do live BDD in my lectures, but then students get too much information at once, for instance I write tests for controller actions and those controller actions itself. So I explain how to test things that students don’t know about first, like how to write tests for controller actions that students don’t know about yet. This renders students clueless of what they’re going to test (i.e. they don’t know what a controller or controller’s action is). If I introduce Rails controller at first, then I write untested code (that’s what I would like to avoid, because it’s not the way BDD should be done), because I tend to make live examples. Seems both ways are not perfect, any ideas?
- Most of students seem doesn’t have right attitude towards remarks, they usually try to protect their own approach instead of considering other solutions that I suggest them. Usually I make constructive explanations, although some of my suggestions can be proven only in production environment. So general question is how to motivate students to make efforts on improving their apps.
- There is an issue of when to give tasks to the students. If I give them at the beginning of semester, then they tend to start completing tasks before they listen to lectures about BDD, it yields not so good results. If I give them later, then students aren’t happy, because scope is too big and there is not much time to complete them. Teach BDD and RSpec before teaching Ruby could be the other way around, but I don’t think it’s right way to go. Any ideas?
Thanks everyone for reading this article, any feedback is highly appreciated, thanks to students for listening to course and developing apps. It was really fun! We will do much better next semester ;) !

Would love to see this as an online course.
Interesting idea, I’ll consider it!
This is very cool. I’m from Białystok, Poland, and it’s very close to your beautiful capital from here :). Maybe I’ll come some time to one of your conferences / meetings—do you have any English language info about such forthcoming events?
Hi Hubert, we mainly do Lithuanian conferences here in Lithuania, so such information is only in Lithuanian language. But it would be great to have something like yearly eastern Europe Ruby Conference in English ;)
Yes, that would be great. An opportunity to meet in nearest future might be Euruko, which is planned this year to take place in Kraków. http://euruko2010.org/
Saunuolis Sauliau, tikrai smagu matyti samoninga zmogu prisideanti prie Ruby bendruomenes vystymo. Sekmes Tavo darbuose!