Wow! Agile Dev Practices 2013
Oh man, what a conference, I am just destroyed as you can see.
AgileDevPractices 2013 has been the first edition of an excellent conference. It was a big surprise for me when Jose Díaz from Diaz & Hilterscheid asked me to select the talks from the many proposals received. I was also responsible for the major part of the program. I didn't choose the keynotes and some other talks. Fortunately the conference has been very successful in my opinion, given that it's the first edition. I have learned a lot and most importantly, I've met incredible people.
I landed in Berlin on Sunday to have dinner with my good friend Vicenç García-Altés, enjoy Potsdam's beer (Potsdamer Stange) and get ready for my workshop on Monday. The workshop went very good thanks to the energy and effort of the attendees.
The speaker's dinner on Monday was very nice. It was close to the hotel so we saved a lot of time that was used for hanging out. I remember very interesting and fun conversations with many speakers. Back in the hotel's bar conversations kept going till midnight.
The dinner on Tuesday was very special too. Two awesome actors performed theater in front of us improvising the scenes based on notes written by us (the audience). I was specially lucky because they asked me to participate on a particular part. I had to move my arms and hands as if they were his. I had an incredible time over there in the stage, a lot of fun. I could have been performing for a long time. This man made it sooo easy for me to move.
The food and wine was lovely. People were willing to meet new people and jumping from one table to another to join conversations. Everybody was very opened to have conversations about business, practices, experiences or just funny jokes. This has been in my opinion the greatest point in this conference. Everyone got the chance to do a lot of productive networking.
There was no planned activity for Wednesday evening and a bunch of us run a coding dojo with JavaScript following the randory style. After that we went to a Russian-Italian-YeahWhatever restaurant where I almost pee in my pants because of the laughs, but this is something I better tell you in the next conf.
Having no planned activity on Wednesday was a great opportunity. The day after, during the lunch time, Vagif Agilov and Gaspar Nagy facilitated a very interesting BDD refactoring dojo, again as a non-planned yet excellent activity.
eBay has been one of the sponsors this time. They had a stand with very kind people, muffins and stickers and were there looking for talented agile developers. This is another good example of the many benefits one can get from attending this conference, ... exciting career opportunities! If you practice BDD/TDD regularly along with other XP practices and have also experiences with other agile methods, contact me and I can forward you to eBay for their teams in London or Berlin.
All the talks I attended to, were good for one reason or another. There were a few talks where the talk itself wasn't very good but then the questions and discussion made them very interesting. They keynotes were astonishing. I specially enjoyed the keynotes by Peter Saddington, Ellen Gottesdiener, Papa Chris Matts & Olav Maassen, and Pawel Brodzinski. And I really appreciated the fact that all of them got the time to hang out with me and others. It was not that they came in just for their keynote and run away right after. It was great talking to you guys!
All slides will be send to attendees soon. Some speakers have also published them, just search for the hashtag #agileDevPrac on twitter.
Can we do better next time?
Don't take me wrong, the conference was worth every single hour and penny. In fact, I feel that I need a week's holiday. However, we are agile, aren't we? And so now that the conference has finished is time to think retrospectively aiming to improve future editions.
Talks in the program were tagged with the level (beginner, advanced, expert). Some talks didn't match the tagged level according to attendees. I believe the level was defined by the speakers themselves but I can't ensure that in all cases. Considering that AgileDevPractices gathers top level experts from all over the world, as an attendee, I expect an advanced talk to tell me things that I (as a practitioner) can understand but still be innovative, teaching me something new. For an "expert" level session I would expect the speaker to treat me like an expert in the subject, meaning that he/she is bringing cutting-edge stuff. If I have to be selecting talks for next editions, I will ask speakers to justify why talks are tagged with "advanced" and "expert" levels.
The second thing we could improve are talks titles. I asked several people why did they choose the talks they attended to, and most of them said they just read the titles, not the descriptions. So titles are very important and they must be self-descriptive (like good code). If I have to be selecting talks for next editions, and I find a title which seems controversial or hard to understand, I will ask speakers to justify the title or change it. A speaker might be tempted to write an appealing title for her/his talk to grab the attention of the potential audience. However, for such an important conference I would ask for honest, clear and concise titles, rather than for marketing strategies. I don't say this happened many times in this edition though.
Last thing I remember we can improve is handling last-minute program changes. This time there were several speakers that couldn't come eventually so the printed program was outdated. The website was updated and there was a big printed and updated time table in the lobby, but still I felt some confusion sometimes. I think we can probably use a mobile application next time to keep everyone updated using phones.
I am wondering now whether it is possible to make the last day as energizing as the first one, because some of us were really tired at the end. Some speakers told me they prefer to talk in the first day rather than in the last one. How can we work around this? Any suggestions?
Thank you very much to all of you!
First of all, a big thanks to Jose, Madeleine and Uwe for their huge effort and the incredible opportunity they have given to me.
Second, to all attendees and speakers. I have met so many nice people that I am not going to write names in here, to avoid missing any of them. Because every single conversation has been important and fulfilling for me. I expect new professional collaborations to emerge from this encounters.
Hopefully I will see you in the Agile Dev Practices next year!
If you write a blog post about the conference, please let me know, I'll be happy to add a link here. Posts published so far:
- Inbetween talks, by Tony Bruce
- http://www.ymc.ch/en/agile-dev-practices-2013-review, by Fabian Kiss
- http://blog.lunarlogicpolska.com/2013/agiledevpractices-2013-trip, by Pawel Brodzinski
As I told to some people in Potsdam, remember that we are organizing an open space in the Canary Islands in June. It's a free community event. The perfect excuse to visit the canaries for holidays with you family. We are planning leisure activities. It starts the 21st, but in the afternoon, so you can still attend to the Test Automation Day in Rotterdam the 20th, and fly to Tenerife the next day
In case you want to know who is already planning to attend and show others that you are participating, join this list.
See you soon!
Interview with Matt Heusser, keynote speaker at the Test Automation Day
I had the chance to meet Matt Heusser (@mheusser) during the Agile Testing Days 2012 conference... and it was great! Matt's keynote was brilliant, excellent, I really enjoyed it. But I think what I liked the most, was that he seems to be a humble and honest guy. One of those guys who's got a lot of experience, knowledge and prestige, but talk to you with respect even if he doesn't know who you are. My good friend Ivan Stepaniuk was lucky and got the chance to share more time with Matt, where he gave us some advise.
Now I've had the honour of interviewing Matt thanks to the organization of the Test Automation Day conference, which will be held in the Netherlands in June 2013. Matt will be keynote speaker in the conference and the whole event looks very promising. If you are a tester living in Northern Europe, don't miss the event
Let's go to the interview:
----------
- How is it going Matt? What have you been working on recently?
Thank you, Carlos, I’ve been busy. Right now I am working on a local ecommerce test project, doing a lot of writing, helping to organize the test and quality track for the Agile Conference, organizing an online test competition in April, and trying to organize a peer conference in Wisconsin, likely in August, 2013.
- In the last decade, teams used to see testers as second class citizens. Testers haven't been involved in the requirements or in development stages, but just as part of the UAT process. Do you see changes in the last couple of years?
It’s a big world, and I see testers at different companies doing different things, so it is hard to draw trends. The complaint of ‘second class citizens’, or being involved too late -- we’ve seen those sorts of complaints for a lot more than this decade. If you go back to the test conference materials of the 1980’s, I expect you would find the same sorts of suggestions, to get involved upfront, to get the requirements right, that sort of thing.
I think two really big things happened in the first decade of this century, though. First of all, the context-driven movement changed the question, asking “If I wasn’t involved up front, and I am brought in late, what can I do to improve outcomes anyway?”, which I think is a healthy question.
Second, the customer-facing testing branch of the Agile School started to talked about what they called Acceptance Test Driven Development (ATDD). Part of ATDD is getting concrete, testable examples early in the process -- helping to augment requirements with specification by example. Deming would have called it ‘operational definition.’ No matter what you call it, testers are good at coming up with the cases of software in use, and programmers are using that to drive development, which means the software is higher quality when it comes out the door. That is eliminating dev/test defect churn, and people are noticing.
- Do you still find companies delivering software without a professional QA team or is that already overcame? How would you explain to them, in short, that they need QA?
Well, I think they need to do testing as an activity, and probably are, though they may be doing it poorly. Programmers tend to not be great at testing for defects, customer-testing, because testing is a sort of destructive activity, and programmers tend to be constructive in thinking. (I am a former programmer, I can say that.) There certainly are problems small enough that that is not a big deal -- a company hiring programmers to write database reports might not need testing as a role.
On more complex things I want to look at the defects the company is showing to the customers. Do they matter? Are they coming in late? Is the company experiencing lost sales or returns because of poor quality? Are programmers spending more time fixing than in building new software? If the answer to any of those questions is ‘yes’, the company may ask for testing help, and, at some point, get more serious about the tester role. I don’t want to force that, though; I’d like the company to decide and then ask for help.
- Where do a professional agile tester start her career? Where is it that one can learn how to become a professional agile tester?
Well the easy way to do it is to find a company doing Agile Software Development, interview, and get hired. That is the easy way (laughs).
I guess I don’t understand the context. Is if if you are a tester now, how do you become an Agile Tester? My advice would be to change your organization ... or ... change your organization. Is the question how to be an agile tester, that is, how to learn what agile software development is an how testing plugs into it? For that I would recommend finding a local user’s group, going to meetings, and reading everything you can find on the subject, from books to blogs to twitter.
- What skills are needed to be a professional tester?
Offhand, I would start with curiosity and systems thinking and the desire to learn. By systems thinking, I mean the ability to model a situation in your mind, to make trade offs, and to figure what happens when those tradeoffs happen. This is the kind of thing you can learn by playing Chess; Gerald M. Weinberg has a couple of good books on the topic. Most of the other things can be taught. Most teams following an Agile approach also require a little bit of teamwork, but to be an effective tester, that is not always required. (laughs)
- What do an independent agile tester like you offer to companies? What is the value they can get from hiring you as a testing consultant?
It depends on what you bring me in to do, but I can give you some examples. The short answer is expertise. When a team has a problem they could probably solve, but they have other things to focus on, they can bring a consultant to get to the bottom of the problem. My role at Excelon is a little different because in addition to consulting, I also stick around and help implement the ideas on real operational projects - I actually do testing. That’s the second half of the value; instead of solving the problems, I can work with the teams to solve problems themselves. Not by lecture in a classroom with powerpoint, but by working through actual operational problems.
One common thing I can do on any project, at any phase of development, is start testing. No requirements document? Fine. I can test. No access to a customer? Fine, I can test. No spec, no project plan? The software won’t build? My gamble is that I can find something to do to add value to the project to justify the investment. Given a little time, I can teach it, so you get skills on the team plus the project is actually done-done earlier, which is something you don’t get with traditional “conduct interviews and write a report” style consulting.
- Is the market asking for more professional testers? are there many job opportunities out there?
It’s funny you should ask. I don’t know about in Europe, but right now in the United States I have a had a great deal of requests lately from all over the place in America. At our last meeting of the Grand Rapids Testers, I think perhaps half of the people there were either building test departments or recruiting testers!
- Why should people attend to Test Automation Day conference?
Too many of us feel vaguely bad about ourselves that we aren’t doing more test automation, and when we’ve tried, we’ve had a fair bit of failure. Test Automation has been the bugbear of software testing for years. Let’s face it. We aren’t likely to solve this ourselves, but by coming together, we’ve got a chance.
- What are the top three books you recommend to learn about software testing?
It depends on the audience. To a professional tester I might recommend Lessons Learned in Software Testing by Pettichord, Kaner, and Bach. Second, How to Reduce the Cost of Software Testing, a collection of essays I was involved in - and perhaps third, the Lee Copeland book on test design. For a manager, executive, or someone new to the concept, you can’t beat Weinberg’s “Perfect Software” book.
- I do know agile testing is continuously evolving, is non-agile testing evolving too?
In some ways, what the agile folks were pushing for twelve years ago when they signed the manifesto are becoming the norm for all the companies I consult with - frequent meetings, (more) frequent release, a willingness to plan iteratively, and so on. So even the “non-agile” problems are become more “agile” - lowercase a.
But I think I take your meaning. There certainly are traditional projects; here in the United States they are likely to be financial, embedded, avionics, that sort of thing, that have a high price of failure that require a more specific process. The context-driven world has made some big strides in that area; I also think that some of the ideas about High Volume Test Automation, the work of people like Dr. Cem Kaner and Doug Hoffman, are starting to gain traction.
- How is agile testing going to evolve in the next decade?
Well you have to ask, in 2003, if I could have predicted where we are today. Could I have predicted that testing would need to scale to hundreds different types of mobile devices running twitter and facebook and google plus and GPS? Probably not. Could I have predicted ‘the cloud’? Certainly not in how it played out.
So testing will probably evolve to scale the needs of software we can’t predict.
Now do I see trends? Sure.
Right now I see a new field emerging, the quality engineer, that comes out of devops. QE’s might be building the build system, the test automation, tying things together, or creating the developer tools to enable self-service environments, push button builds, and deploys/rollbacks to production.
The reason it is a new field is because the companies doing it are doing it with open source tools. Everyone is rolling his own. It is possible, over the next few years, that some commercial companies (or very successful open source projects) make this the sort of thing any company can implement easily - that we start to build a body of knowledge around chef and puppet and such. When that happens, a lot of waste is going to disappear from the system. Testers on those sorts of projects will need to find new ways to contribute and add value.
The second disruptive innovation I see are crowdsourcing projects uTest that allow companies to harness exploratory testing from the cloud. That is going to eat into the market for testers. Once again, to stay in the game, we’ll have to improve, because companies will be able to outsource the quick attack stuff to a crowd vendor cheap.
Of course there will continue to be big, slow, traditional companies building traditional software that don’t change much; many banks still run COBOL. The testing equivilant to COBOL will be with us for years to come -- it just isn’t very fun!
----------
Thank you very much for your time and your inspiring answers Matt!
I hope the readers will enjoy the answers as much as I do. This post is going to be updated in the next couple of days/weeks, I will add links to the many references Matt points out in the interview.
Dear Leanpub first-time author
I've only written a book, enough to know how much work it is. Before writing it, I used to think that writing was going to be the most time-consuming task. However, it turned out that I spent more time fixing mistakes, reading again and again what I wrote and, specially, applying changes based on my dear reviewers' feedback. The first draft I wrote had nothing to do with the final version. The reviewers where friends as the book was self-published. And reviewing was hard to them. Some of them stopped following revisions as the chapters were mutating.
As a reader and also as a reviewer of other books, I like to give feedback to the author once the book is in a very advanced stage. Once the author has read his book so many times that she is tired, and she thinks it is ready to be published. At that point feedback is more precise and changes are easier to apply. Less work and better experience for everyone.
Guess what my advise is?
Do not invite your reviewers to read your book when you consider it is 50% done. Wait until you think it is pretty much done. When you consider you've got all the chapters in and you are happy with the content. At this point is when you really got 50% of the job done, but you believed you were 90% ![]()
Well, if you have been writing for many months and the book is going to be huge, then you need feedback sooner. But for the average 200-300 pages book, I would rather wait.
You can ask your reviewers about the general table of contents, or maybe about some technology your are talking about, but going through the whole book soon is not a good idea in my opinion. As the book evolve, your reviewers will be tired. And worse than that, some of them might have a wrong idea about the final version, just because they left the project too early.
Care about your reviewers' and readers' time as much as you care about your own time
And remember, never write a book for money. Write it because you feel like sharing with others. If the book is good, the reward will come, but not in the form of direct money from the sales.
Visit Tenerife during the Agile Open Space
There are two major events in the Agile-Spain Community. One is a conference and the other is an Open space. In June 2013 (21st and 22nd), the Open Space will be held in Tenerife, Canary Islands, a paradise in the middle of the Atlantic Ocean. Perfectly connected with Europe thanks to its two international airports.
I am helping with the organization, am part of the staff in this edition. In previous editions, we haven't had talks by non-Spanish people. It would be great to have guests from all over the world this time. We would love to have talks in English during the event. Everyone will understand English (although not everyone would be able to speak fluent English) so it is a great opportunity to meet the Spanish agile community. There will be 2 or 3 tracks. At least we will have a technical track and a management track. Between 150 and 200 people from all over the country will attend.
We are planning leisure activities the days before and after the event, for those willing to spend some days off in the island. I'll be organizing a "snorkling" morning for example:
All I say in the video is that you should bring your diving mask
We'll go hiking, on party, and more. You will also enjoy traditional local dishes (home made!). Perfect for holidays and networking.
These islands are an excellent place for outsourcing development and this is the perfect opportunity to meet the right people
Open Space Date: 21st and 22nd, June 2013
Current Website (will change soon): aos2013.wordpress.com
As this is not a conference, travel expenses won't be refunded, because we don't even know who is going to be a speaker (this is an open space). However, we will probably get nice discounts for accommodation. Lunch and dinner will be covered by the sponsors.
I am also planning an edition of my BDD workshop for JavaScript developers in the same week. The workshop will be in English
For more information about the workshop date, please subscribe to the upcoming workshops list.
If you need any other information regarding the event, please contact me directly at "carlos AT iexpertos DOT com".
See you in June
Share what you learn, to learn even more
I always encourage developers to write a technical blog. I've already convinced some of them to start blogging... yeah!
Why is it that you explain your problem to other person (or even to a rubber duck) and you find the solution yourself as you describe the problem? The brain works differently when you think without talking loudly, than when you talk or write.
There are different learning levels for techniques:
- You discover there is something new you want to learn.
- You start reading how others use the technique but don't understand what they are doing. It's confusing at first.
- You start reading how others apply the technique and you understand what they do, but you can't do it yourself.
- You are able to start doing it by yourself.
- You explain what you know to others and then new doubts and thoughts pop up, and you get a deeper knowledge.
- You teach people on the technique and that gets you closer to the master level. The more you teach the more you learn.
- You eventually become a master.
Write a blog
Just do it for yourself, write notes that can be helpful for you in the future. Explain what you learn. It might help others and it will definitely help you, just for the sake of learning. Don't worry too much about your writing style, you are not writing a book and it is your blog, don't let the wording stop you from your willingness to share. In my case, every time I write in English, I learn more English also, so it is not only technical stuff that I learn. However, I prefer to write it even feeling that I am making some grammar mistakes, rather than keeping the draft for months, waiting for the perfect moment to polish my writing to come off. I try to deliver frequently and learn from my mistakes. All I know is reading my post when I finish it to fix the mistakes I notice.
Talk to others
Don't miss the opportunity to expose what you learn in your local community. Talk to others and present papers for conferences. But if you decide to talk in a conference, prepare your pitch upfront. Prepare your slides and your talk very well before doing it. The more you practice your pitch the more you will learn and the better it will be for the audience. Don't be afraid when talking for a big audience, nobody is better or worse than you, you deserve all the respect, and so your audience.
Teach what you know
If you don't want to feel uncomfortable as the questions come in, you better know what you are talking about. This means you have to prepare the classes very well, and that will help you to know the technique really well. Teaching is a great motivation to learn. If you don't have experience as a teacher, my advise is to teach your friends or colleagues in your local community for free, until you reach the point where others confirm you they are taking value from your lessons.
I hope to inspire more developers to, at least, start a weblog
Event oriented programming with JavaScript
Event oriented programming promotes low coupling but not necessarily high cohesion. Always consider the Single Responsibility Principle while designing collaboration through events. I see three primary ways of collaboration:
One to One
A single object communicates with other (a collaborator). This can be done with dependency injection the same way we do it in Java or any other language (and you don't need Spring for that!). JavaScript provides another mechanism for one2one communication, the DOM Level 0 traditional way of event handling. A very useful and powerful way of adding hooks/ports to plug new behavior in, still promoting low coupling. If you need to change the collaboration in the future, from one2one towards one2many, it can be done easily. In some cases I see this as a more decoupled way of dependency injection.
function Car(){ this.go = function(){ /* some calculation over here */ this.onLowFuel(); }; this.onLowFuel = function(){/* event */} } function RacingTeam(){ function getReadyToFuel = function(){/* whatever */}; this.addCarToRace = function(car){ car.onLowFuel = function(){ console.log('low fuel!', this); getReadyToFuel(); } }; } var car = new Car(); var team = new RacingTeam(); team.addCarToRace(car);
As you might realize I know nothing about car races
but I hope you understand the code. When implementing traditional dependency injection, the car knows it depends on a team, but it doesn't know the particular implementation of the team. With the DOM level-0 traditional way, the car doesn't even know it will be used in a team. All it knows is that it has to inform someone else about its fuel level when it gets low. However, the team's got to know about the car. Still the team should not know about the particular implementation of the car.
To test-drive this behavior, you probably need two steps. First one, make sure the car triggers the event and second, make sure the team handles the event. I wrote the two tests in a previous post. DOM level-0 traditional is the main mechanism I use for one to one collaboration, it's got however some pitfalls worth considering.
Pitfalls
- You might not know some object is already handling the event: the handling mechanism is simple, we are just replacing the original function in the object triggering the event. If we try handle the same event twice, there will be only one handler, the last one. I always use the "on" prefix for those methods that trigger events as a convention to know it is an event with a single handler.
- You might make mistakes with the "this" keyword: in the code above, what do you think "this" is when we invoke console.log? It's the car object, not the team. It's a problem with a very easy solution though. I usually have a reference to the handler doing "var self = this;". Some people prefer the "bind" method to do the same.
One to Many
For one to many collaboration there is the Observer pattern. jQuery implements the observer pattern to expose events such as "click":
$('#closeButton').click(function(){ /* the event handler 1 */ console.log('handler1'); }); $('#closeButton').click(function(){ /* the event handler 2 */ console.log('handler2); });
When the button is clicked, both handlers are executed. When I implement the observer pattern in my objects, I prefer to make it explictly:
objectTriggeringTheEvents.addSubscriber('eventName', handler1); objectTriggeringTheEvents.addSubscriber('eventName', handler2);
The "addSubscriber" makes clear to me, that I can have several subscribers. This is specially important to distinguish from one2one collaboration.
As an exercise I leave out to you the implementation of the observer pattern with TDD.
I use one2many collaboration when I really need the object to be observed by several objects, which happens to me, less often than one2one collaboration.
Many to Many
Different objects might trigger the same event and there might be a bunch of other objects subscribing that event. This is the case of a many2many collaboration. Or, I might not be interested in the source of the event, I might just want to handle it. This usually happens at the infrastructure level. For example I use it to know when the window is being closed. I don't care who is responsible for realizing the window is being closed but I do want to know it in several parts of my application to shutdown properly. So I create an object which subscribes to "window.onbeforeunload" to be aware of window closing and in turn, emits the event through a "bus" where subscribers are listening.
This is the less coupled way of interaction between objects, but it comes with counterparts: code gets harder to follow. This is the publish/subscribe pattern. My advise is to use this pattern only when strictly necessary and not as a the default mechanism for event oriented programming.
There are several open source libraries implementing this pattern. As an exercise, try to develop it from scratch, test-first. This is the code I ended up with while implementing my own pub/sub:
EventBus = function(){ var subscribersInfo = []; this.addSubscriber = function(callback){ var eventNames = [].slice.call(arguments).slice(1); subscribersInfo.push({ subscriber: callback, eventNames: eventNames}); }; this.emit = function(eventName, eventArgs){ for(var i = 0, len = subscribersInfo.length; i < len; i++){ var info = subscribersInfo[i]; for (var j = 0, lenj = info.eventNames.length; j < lenj; j++){ if (info.eventNames[j] == eventName) info.subscriber(eventName, eventArgs); } }; } };
Best practices for JavaSript RIAs
Last month I was in Madrid talking about best practices for JavaScript RIAs, in the monthly meetup organized by MadridJS. Here you have the slides:
The talk was in Spanish. I expect to give this talk in upcoming conferencies, in English
Deiser rocks: integrating with Jira
Last friday was awesome. Leo Murillo and Carlos Fernandez, from Deiser, were helping me out with the integration of Atlassian Jira in LiveTeamApp (my latest application for team productivity). We spent the whole day learning about Jira integration and ended up with a nice spike containing all the information I need to develop a new version of LiveTeamApp supporting Jira. The task manager will read your Jira tasks and save the time spent back to Jira, while working with LiveTeamApp to make your current work visible in real time to your teammates.
Deiser is an amazing company, recently well-known for their expertise in Atlassian products and the great plugins they are building for them. Workload is one of them. If you need support on any Atlassian product, go for Deiser, these guys are experts indeed and they demonstrated that to me as we were coding together.
What surprised my a lot was that they spent the whole day with me just for the sake of collaboration. Just to help me to improve my application, making it more useful for Jira's users. We worked in their nice office, had a great lunch and a very productive coding/hacking day. The passion for their work is energizing. I am very grateful to Deiser's CEO, Guillermo Montoya for this nice gift, and of course to Carlos and Leo for their effort and kindness. Now some details on our work:
Integrating with Jira
At the beginning we tried OAuth as the authorization mechanism to make LiveTeamApp read Jira's tasks and add time spent to them, through the REST API. But I wasn't the easiest choice so we went for basic authentication with login/password. The authentication is sent in the http headers. This is the spike's code to retrieve user tasks using Python and Flask and the Requests library:
@app.route("/jira/listTasks/<jiraHost>") def listJiraTasks(jiraHost): url = 'http://' + jiraHost url += '/rest/api/2/search?jql=assignee=currentUser()' url += ' and resolution=Unresolved' req = requests.get(url, headers={'Authorization': 'Basic Y2FybG9zOmNhcmxvcw=='}) return req.json()
The hash in the header (Y2FybG9zOmNhcmxvcw==), is the string "username:password" base64encoded.
And this is the code to add time spent to a task:
@app.route("/jira/updateTask/<jiraHost>", methods=['POST']) def updateJiraTask(jiraHost): url = 'http://' + jiraHost + '/rest/api/2/issue/TEST-3/worklog' req = requests.post(url, headers={'Authorization': 'Basic Y2FybG9zOmNhcmxvcw==', 'Content-Type': 'application/json'}, data=simplejson.dumps({ "comment":"Adding Worklog thru other app", "started":"2013-01-12T10:30:18.932+0530", "timeSpent":"2d" })) return req.json()
At the beginning we tried to do everything from JavaScript, from LiveTeamApp's client side, but due to restrictions with cross site scripting security in the browser we translated the request to the server side.
I don't have a release date for this feature to be done but it will be soon. Get ready for LiveTeamApp, you Jira user
I hope to work with Deiser's people again in the future, we had definitely a great time
BDD applied to JavaScript RIAs
Is there any difference in the implementation of Behavior Driven Development in the case of a Rich Client Application (or Rich Internet Application) ?
BDD's primary goal is communication. In that regard, there are no differences. However I see the differences in the outside-in implementation techniques.
There is no need to test the application through the GUI to make sure the specifications (customer acceptance criteria) are met.
With JavaScript we can easily test anything in the GUI with the help of the Passive View Pattern and some fine-grained integration tests against the DOM. This means that I can ensure the GUI connects with the application using unit tests + fine-grained integration tests. I can cover all the paths with automated tests, most of them unit test.
In a traditional website I can't "mock" a panel (or any other view) to check that some text has been added to it as a result of a "click" event triggered by a button. In fact, we can't use truly event oriented programming. Because the UI is just a picture, rather than a set of objects with methods, behavior. With JavaScript this is a big advantage because we can use test doubles for those views in the unit tests, and then write contract tests to make sure those views manage the DOM properly. As a result, what in traditional web development have to be integration tests, now are unit tests.
We are back to those days where libraries to handle GUIs were so powerful and nice for both, developers and users. This time with 10+ years experience in agile testing and all kind of testing tools.
Thanks to this fact, we can design a Ports and Adapters Architecture for our application so that the GUI is just another port, at the same level than the acceptance tests. I can express the scenarios using plain JavaScript (or CoffeeScript) accessing the application through the "tests adapter", ignoring any GUI detail.
If I use Cucumber (I am using SpecFlow right now), my step definitions do not hit the UI. They just load the page and access the Business API (test API).
[Given(@"^I start a new task$")] public void GivenIStartANewTask(int minutes) { var browser = ScenarioContext.Current[browserKey] as IWebDriver; var navigation = browser.Navigate(); navigation.GoToUrl(appUrl); var jsExecutor = browser as IJavaScriptExecutor; // invoking my JavaScript Business API here var invoked = (string)js.ExecuteScript( "return app.startNewTask();"); // making sure the Business API got the call invoked.Should().Be("newTaskCreated"); }
The "Should" comes from FluentAssertions. The browser is Webdriver (Selenium).
If I don't user Cucumber, another option is to directly write the scenario with CoffeeScript.
describe "LiveTeamApp: the team productivity application", -> beforeEach -> loadApp(appAddress, initTests) describe "the tasks management system", -> it "counts the time consumed by every task", -> app.startNewTask() waits two.seconds app.finishCurrentTask() app.lastFinishedTask.elapsedSeconds.should.equal(2)
This is Jasmine plus Chai's syntactic sugar (should).
This scenario is actual code from my application LiveTeamApp.com, which has been developed entirely following this process (please check it out with your team, I believe you will like it
Notice how I am writing a programmatic interface (the test adapter) to talk to the application with the language of the domain.
For asynchronous cases, I am writing a small fluent API called Flas, which uses Gherkin to encapsulate blocks containing jQuery ajax requests. The Given-When-Then blocks scope asynchronous calls so that every block is executed once the calls have finished.
For more complex scenarios where I need several instances of the application at the same time (to design and test how users interact with each other), I am using CasperJS. This the case of LiveTeamApp's chat service, where users can chat with each other and also chat with the whole team. The acceptance criteria has been written with CasperJs to open several browsers and use the programmatic API from all of them to interact. Again, no need to hit the GUI in those acceptance tests.
My friend Ivan Stepaniuk and I presented this work and ideas first in Agile Testing Days 2012. Since them I am improving my technique, to write better and better acceptance tests.
The workshop
If you want to learn more and practice the technique, I encourage you to attend to my workshop. In the workshop you practice the whole BDD cycle, from the specifications workshop to the views implementation. See more information about the workshop in this post.
The book
I am starting to write a book on this. If you want to help me out with it please let me know. I expect it to be published in late 2013 or 2014. There is a great book on TDD with JavaScript written by Christian Johansen. It covers thoroughly all you need to get started with JavaScript and TDD as well as advanced topics. I'll try to write my book as a complement to Christian's. My TDD style is a bit different from Christian's but my motivation to write the book is not because of that, but to show readers the whole BDD cycle in a rich client application.
I won't repeat the great lessons you can read in The Cucumber Book which is a must-read. Even if you are not using Cucumber, Matt's and Aslak's book is fantastic to learn BDD.
The other books I would expect my readers to read before, are the ones by Gojko Adzic on Briding the Communication Gap and Specification by Example
The sticky scroll bar inside the draggable
jQuery UI draggable is so cool! However, if the draggable element (or any of its children) contains a scroll bar, clicking on it will result in the mouse pointer stuck on the whole draggable element forever. To avoid that, use the "cancel" option:
$('#theDraggable').draggable({ cancel: "input, textarea, .someClass" });
And it will work perfectly
At the time of this writing, I am using jQueryUI 1.8 version.






