Skip to content

Open Source

A Smattering of Selenium #148

Selenium - Mon, 05/13/2013 - 16:51

Gotta start this up again…

  • The Evil Tester Guide To HTTP Proxies appears to be more for using proxies for manual testing, but you should be running your automation through one as well so it helps to understand the magic that takes place.
  • New BrowserMob Proxy release. Bindings should all be updated for the newly exposed methods in a couple days.
  • 5 Things You Should Stop Doing With jQuery – Not sure whats better, the content, or the Saved By The Bell theme
  • testtools is the latest hotness in the world of Python runners?
  • Boris looks pretty useful for the PHP folks
  • Google’s Scaled Trunk Based Development – even if you are not Google, you should be doing this. Or as much as you can (again, you are likely not Google)
  • Reliably Testing Asynchronous UI W/ RSpec and Capybara isn’t new, but the wait_for_dom thing is new [to me]
  • In defense of <canvas> – canvas worries me
  • One Does Not Simply Set Profile for Remote Chrome is Watir, but links to the pure WebDriver in SO article. I don’t think any of the other bindings deliver chrome profiles over the wire…
  • The Moodle Functional Test Automation Harness – always fun to peek into other’s suites

  • Categories: Open Source

    Sonar in the news

    Sonar - Thu, 05/09/2013 - 09:54

    Welcome to the roundup of blog posts and pages that mentioned Sonar last month…

    Serie of article about Sonar installation
    By Jean-Pierre Fayolle, 7 April 2013
    Jean-Pierre Fayolle continues his series of articles about Sonar installation with 5 new articles:
    Install Sonar – The Sonar webap
    Install Sonar – Sonar Runner
    Install Sonar – First analysis with Sonar Runner
    Install Sonar – Jenkins
    Install Sonar – The Sonar Jenkins plugin

    Categories: Open Source

    Giving Back to the Community: 3 Ways to Keep Jenkins Growing

    With more than 600 plugins, Jenkins has a vibrant community and we're dependent on YOU to keep it that way. Here are 3 ways you can give back to the community to ensure that everyone benefits and Jenkins keeps growing...

    Giving it back to the community #1: vendor+community=win

    Jenkins is becoming ubiquitous enough that tool vendors and service providers often find their users asking them to provide Jenkins plugins. The challenge for these companies is that they don’t necessarily possess the necessary Jenkins expertise to do one.

    Here at the Jenkins project, what we are trying to do is to work with these people to deliver a plugin. It gets the job done a whole lot more quickly if the vendor brings in their expertise on their tool/services and we bring in our expertise on Jenkins plugin development.

    For example, we recently worked with SOASTA to help them open-source the plugin they developed in house, then help them add a whole bunch of new functionalities. By open-sourcing a plugin in the Jenkins project, vendors win as the community helps fix bugs and improve plugins. The Jenkins project wins by building relationship with vendors. And finally the users win by having more integrations.

    So the next time you ask your vendor to provide a Jenkins integration, please tell them to drop us a note, and we are happy to talk.

    Giving it back to the community #2: scratch your itch and take credit

    If you are working for a company and hacking some Jenkins plugins for your team, then you should definitely consider contributing those changes back. Let’s take Robert and Tomas for example, who contributed a number of significant plugins from Sony Mobile.

    • The company wins, because it shows off their technical excellence. Plus the flexibility to let engineers work on these OSS projects helps them retain and attract high-caliber developers. It also lets the community shoulder some of the burdens of maintaining plugins.
    • You win, because now you have more things to show to future employers. After all, GitHub is your new resume! And when you aren’t sure how to go about implementing a feature or fixing a bug, open-sourcing your plugin lets us jump in and get you unstuck.
    • The community wins, thanks to your new awesome plugin.
    • Besides all of those pragmatic reasons, when you share something with others and they tell you how much it helped them, even if it’s just one or two people, it’s a deeply moving experience.

    It just has so many advantages, it’s a no brainer!

    Giving it back to the community #3: contribute by proxy

    If you are working for a company, wanting to see particular features/integrations in Jenkins but don’t have time to do it yourself, there’s yet another way, and that’s to contribute by proxy.

    The idea is that you contract with those who already know how to develop Jenkins plugins, and you have them produce/improve Jenkins plugins in open-source. Praqma is a great example of one such company. They are well connected in the community, with lots of experience under their belts, and your company takes the credit for the work. There are also a number of individuals who can do this for you.

    Why give it away something for free when you paid for it, you might ask. That’s because the code sitting in house rots when it’s not maintained by anybody. In contrast, when the rest of the world can hack on your code, you get occasional random bug fixes by strangers (the worst case), and sometimes it gets its own life (the best case.)

    If this way of giving back suits you better, feel free to send an e-mail to the dev list.

    Categories: Open Source

    Registration & Call for Papers Open for JUC Palo Alto

    This year, the West Coast Jenkins User Conference will be in Palo Alto rather than San Francisco. If you’re nearby – or even if you’re not – join Kohsuke and other fellow developers for a solid day of Jenkins.

    The Call for Papers is open until June 9 (scroll to bottom of page for form). JUC will be much better with your involvement, so please submit your abstracts and share your Jenkins knowledge with the community.

    Kohsuke Kawaguchi – Keynote Address, JUC San Francisco

    A very special thanks to our JUC Palo Alto sponsors, who will make sure you are fed, caffeinated, clothed (in this year’s collectible Jenkins tshirt), and generally well cared for at the conference: CloudBees, JFrog, XebiaLabs, appvance, ZeroTurnaround, LMIT Software, Black Diamond Software, New Relic, Liferay, AppDynamics, and SOASTA.

    Two other differences this year – the conference is not timed to coincide with JavaOne, and it falls on a Wednesday rather than a Sunday. We thought we’d try these changes and are interested to know if they work better for everyone.

    The agenda won’t be populated until after the Call for Papers closes and talks are selected. But you can check out previous JUC agendas, slides, and video:

    If JUC Palo Alto is not convenient for you, there’s also a JUC coming up in Herzelia, Israel on June 6 and a Jenkins event planned for Copenhagen, Denmark on September 6.

    Hope you can join us at JUC!

    Categories: Open Source

    Watir Team News

    Watir - Web Application Testing in Ruby - Sat, 04/27/2013 - 16:44

    I have some great and some sad news. Let’s start with great news.

    Great News! :)

    Joel Pearson

    Joel Pearson

    Joel Pearson joins the team as support sheriff.

    Bret Pettichord’s nomination:

    I would like to nominate Joel Pearson as a support sheriff for Watir. He is active every day on the ruby-talk mailing, answering questions about testing with Ruby and frequently recommending Watir-Webdriver as a solution.

    (…)

    Here is an example of what I am talking about.

    http://www.ruby-forum.com/topic/4407767

    Bret

    Joel about himself:

    Hi all,

    Hopefully I’ve done this correctly as I’ve previously always used
    forum interfaces for mailing lists.

    My programming experience is just over 2 years, Ruby for about 1 year.
    I started using Watir-Webdriver just under a year ago while trying to
    build an automated interface for a web-based stock system. I basically
    just built a few front-ends for ease of use, capable of batching
    repetitive tasks and analysing information.

    Since then I’ve developed some of my own wrapper classes to use within
    my company for reporting and bulk processing, allowing me to write
    customisable reports quickly from a template. I would say I’m still a
    novice programmer, but as I’m being paid for this work I guess I’m
    technically a “professional”.

    I’ve made a few minor alterations to my local watir-webdriver files.
    The main one was adding an optional timeout length while waiting for
    javascript alerts. I wrote that a while ago so I could probably do it
    better now.

    I’ve also started work on my own gem which attempts to emulate
    Microsoft Excel’s API as an invisible workbook class. This is to
    simplify manipulation of data when analysing HTML tables, and to make
    the transition from Excel VBA to Ruby a bit easier. It’s still in the
    early stages of development at present.

    The Ruby mailing list was (and still is) a great source of helpful
    advice when I was starting out learning how to use Ruby and Watir; so
    I continue to participate in the hopes of giving something back to the
    community in return for all the help I’ve received. And, of course, to
    continue to benefit from all the great advice on there.

    Links which may be of interest to you:

    Some of my old posts feel a bit cringe-worthy when I look back at
    them, but that’s all part of learning. I’ll stop rambling now, let me
    know if there’s anything pertinent I missed.

    Thanks,

    Joel

    Sad News :(

    Bret Pettichord

    Bret Pettichord asked to be moved to alumni section.

    It is time to move me to the Alumni list, as I am no longer an active contributor to the Watir project. I don’t contribute code any more and I haven’t helped manage the project since hosting the Watir Bazaar a year ago (March 2012). I’ve asked others to recognize when they’ve stopped contributing. Now it is my turn.

    I should make clear that my team still uses Watir-Webdriver (and WatirMark) every day, so we continue to be users and I continue to encourage my team to contribute to the project. I am also very happy with the current team that has been keeping the project active, especially the leadership provided by Jari, Jarmo and Zeljko.

    (…)

    Last year I had been working on an application for membership in the Software Freedom Conservancy, but realized that I did not have the commitment needed to submit it. If others would like to pursue this, I am happy to support their efforts.

    Bret

    Tiffany Fodor

    Tiffany Fodor also asked to be moved to alumni section.

    Hi all!

    I saw in an earlier message where Bret asked to be moved to the alumni section on the Watir.com site because he hasn’t done much with the team in the past year. It occurred to me that I’ve likely done even less and should be moved to the alumni section as well.

    I still use Watir-classic every day – thanks so much for keeping us IE-saddled folk in up-to-date Watir code! We’re in a “do more faster” mode here at ICAT and I don’t have much time to help out with the support end of things. I’ll try to look in from time to time, but I can’t promise to help on a consistent basis. Also, I don’t have the skills to be updating the source code.

    I’m happy to help with the Software Conservancy application if we’ve decided that’s how we should move forward. Please let me know if I can be of help with it without just making it more complicated by handing it off.

    I hope all is well with each of you – I missed seeing you all in Austin this year!

    Take care!

    -Tiffany

    Hugh McGowan

    Hugh McGowan is the last one to ask to be moved to alumni section.

    Hi all,

    Seems like it’s the season…

    While I use Watir-Webdriver daily, it’s been over a year since I’ve checked in or released code, so I should probably be moved to the alumni list as well.

    It’s been great fun – I’ve learned tons and met some awesome people. Keep up the great work Jari, Jarmo and Zelkjo!

    I’ll still lurk on this list and am happy to help with anything y’all need so feel free to ask. Let me know if you’re ever in Austin!

    Thanks!

    Hugh


    Categories: Open Source

    Watir Gems Updated

    Watir - Web Application Testing in Ruby - Sat, 04/27/2013 - 16:05

    Multi Colour CubicZirconia

    Hi everybody!

    A few Watir gems got updated recently. I just wanted to make sure everybody is up to date. :)

    watir-webdriver:

    watir-classic:


    Categories: Open Source

    Customizing Sonar to Fit Your Needs

    Sonar - Fri, 04/26/2013 - 11:27

    Sonar is a super-radiator for code quality and as such, you can expect it brings value to all stakeholders in a development group. To achieve this, Sonar must be able to show only relevant information in a certain context and shut off the noise to facilitate investigation and decision making. In this post, I will show how to customize Sonar to fit your needs by:

    • creating filters that choose components and metrics to report on
    • building your own widgets and dashboards
    • selecting default dashboards displayed
    • using the notification services and stay tuned

    To start customizing Sonar, you first need to log in.

    Creating Your Own Filters

    The mesures service located in the top navigation bar enables to choose which components you wish to retrieve and which measures you want to display for these components. Once you have chosen these criteria, you will get what we call a filter. A filter can be saved, updated… Filters are fully compatible with differential services, so you can display variations as well.

    We will see later on how to display a filter in a dashboard. See the Measures Service documentation page to learn more on filters.

    Building Your Own Dashboards

    To make sure you maximize value in Sonar, you have the ability to create your own dashboards and select the widgets they display. Two types of dashboard are available:

    • Projects dashboards: to display quality indicators on a component such as a Project, a View or a Developer. Once you create such dashboard, it will be available to any component.
    • Global dashboards: to mix any information on different projects. A global dashboard will only be available on the home page. You can look at Nemo for an example.

    To create a new dashboard, you can use the Manage Dashboard link from the home page (for a global dashboard) or from a project page (for a project dashboard). Once the dashboard is created, you can then configure by a drag & drop of widgets.

    There are many available widgets, but to configure a widget that uses your own filter, you should pick the “Measure Filter as List” or “Measure Filter as Tremap” widgets and choose the filter you created.

    Choose Default Dashboards

    Now that you know how to customize Sonar for your own needs, you also might want to customize the default dashboard that anyone can see. Once you have created the dashboards you want to use by default, you will need to share them. Once they are shared, go to settings, configuration and Default Dashboards. You can pick from there what you want as default for global and project dashboards.

    Subscribing to Notifications

    Finally, to stay tuned, you can subscribe to notifications that you will receive by email. Go to YourUserName > My Profile and tick what you want to subscribe to in the Notifications section.

    You may also want to receive a quality report on a regular basis. Thanks to the Report plugin, you can select which global dashboards you would like to receive by email as a PDF report and how often.

    Time now to give it a try. Enjoy and give us feedback!

    Categories: Open Source

    Munich Hackathon

    It's been a while we had a hackathon in Germany. Let's get together, get some coding done, and get to know fellow Jenkins developers! The date is June 15th Saturday.

    TNG Technology Consulting, where Stefan Wolf (dependency graph viewer plugin, etc) works, will be hosting us (thanks!)

    We'll try to arrange some themes or agenda, based on who's coming and how many of us will be there. For example,

    • If there are many people who have never done a plugin development, we can do a plugin development tutorial.
    • If we see a concentration of devs in a specific area of Jenkins (say mobile), we can try some focused development in a specific area.
    • If you have things you need from the core to do what you want, this is the chance to get that implemented on the spot!
    • If you want to see a certain development happen in Jenkins but don't know how, please make a pitch to us in the form of presentations (short or long) would be welcome

    Finally, assuming there's interest, we'll head out somewhere for a dinner afterward.

    If you are interested in coming, please RSVP at meetup.com so that we can prepare accordingly.

    Categories: Open Source

    Neuroscientists embrace continuous integration served by Jenkins


    Guest post by Yury V. Zaytsev and Abigail Morrison. To download the PDF file of the journal article mentioned below, click here!

    As recently exemplified by several reports on this blog, automation tools such as continuous integration servers, that help to defuse the exploding complexity of software under the ever-increasing pressure to deliver, are steadily gaining well-deserved mindshare in the industry.

    However, it is not just developers of enterprise software who need solutions to the complexity problem. Scientists are arguably even worse off: most of them are not trained as software engineers, yet, in the last decades, creating custom software has become an integral part of virtually any research activity, be it data analysis, simulation or experiments. Frequently, there is a great emphasis on numerical accuracy and reproducibility of results, which requires extensive testing. As a coup de grâce, most publicly funded research projects are running on tight budgets, excluding the possibility of hiring professional contractors to outsource required software development work.

    Enter Jenkins the Butler!

    Back in 2011, Yury V. Zaytsev, a doctoral candidate now working at Jülich Research Center, Germany was supported by a Google Summer of Code stipend to design a continuous integration infrastructure for NEST, a spiking neuronal network simulator for neuroscientific research released under the GPL license. An overwhelmingly positive experience with this new setup motivated him to write up a case study, which was recently published in "Frontiers in Neuroinformatics", an open access scientific journal.

    "The new CI system boosts our productivity, because it helps us find and fix breakages very quickly, even when they only occur for obscure combinations of configuration options. Automated integration testing is a major breakthrough for NEST, as it ensures that developing new features does not come at the cost of reliability or accuracy" - said Markus Diesmann, director of the Institute of Neuroscience and Medicine (INM-6) at the Jülich Research Center, Germany and NEST Initiative board member.

    We hope that through a peer-reviewed publication in a prominent scientific journal we will be able to reach the scientific community more efficiently, as compared to the materials targeting professional software developers. However, we likewise believe that our case study might be of interest to the readers of this blog, especially those who are still only considering implementing continuous integration.

    Lastly, we would like to thank all developers and users of Jenkins whose contributions throughout the years made it the versatile and robust continuous integration server it is today!

    Categories: Open Source

    UNIT TESTING HORROR STORIES – SHARE YOURS NOW!

    The Typemock Insider Blog - Mon, 04/15/2013 - 11:07

    header_ut_horror_stories

     

    Yeah, we know unit testing is not always easy.

    With over 50,000 Typemock users worldwide, we’ve heard it all before: crazy deadlines, pesky bugs and difficult bosses. But we also know that when you stick to it – it’s all worthwhile!

    We want to hear your unit testing horror story, whether you succeed or not, so others can learn from your experience and better cope with the difficulties of getting there. And let’s face it – it’s always amusing to hear about it!

    Post your story on our special Unit Testing Horror Stories webpage (via the Facebook “comments” plug-in, so you’ll need to be logged in).

    If you don’t have a Facebook account, you can email your story to: social@typemock.com, and we’ll post it on your behalf.

    Our team of experts will pick the best ones, and award their contributors with some great prizes, and a chance to become one of our Unit Testing Evangelist.

    Hurry up! Entries accepted until Tuesday April 30. spider

     

     

    Categories: Open Source

    Sonar in the news

    Sonar - Thu, 04/11/2013 - 10:55

    Welcome to the roundup of blog posts and pages that mentioned Sonar last month…

    Code Quality Tools Review for 2013: Sonar, Findbugs, PMD and Checkstyle
    By Adam Koblentz, 12 March 2013
    When we released our Developer Productivity Report last year, it was the first time we asked our respondents about Code Quality Tools. Code quality tools fulfill a growing need, as our code bases become larger and more complex, and it’s important to try to automate your code checks as much as possible. They are pretty versatile and customizable, and typically they are integrated into your build process, but can also be run manually in a one-off fashion.

    Dependency Inversion Principle
    By Monte Wingle, 13 March 2013
    This 20 minute video demo shows: How to install and start Sonar, A very simple java project with no dependency cycles, What creates a red mark (dependency cycle) on the Design page, A Sonar analysis showing the cycle, How to fix that red mark using the Dependency Inversion Principle, A final Sonar analysis showing a clean design page again with the functionality unchanged.

    Install Sonar – Oracle Loopback Adapter
    By Jean-Pierre Fayolle, 10 March 2013
    We will discuss in this post how to install a Loopback Adapter needed to use Oracle on a standalone station, such as a laptop for example. The first thing to do is to check if you already have one on your machine.

    Analyze a Web Dynpro Java project with Sonar
    By Tobias Hofmann, 21 March 2013
    Sonar offers two “basic” profiles to analyze a project. Sonar uses Findbugs to analyze not only the source code, but the binary version for violations and possible bugs too. “Sonar way” is looking at the source code. This allows for finding the most common violations with minimum effort. “Sonar way with Findbugs” also takes the CLASS files into consideration.

    Install Sonar – Oracle user
    By Jean-Pierre Fayolle, 25 March 2013
    Today we will use this console to create an Oracle User that will allow us to have a SONAR schema in our database. If you did not keep the url of the Oracle console, no problem. You should have a Windows menu that allows to launch it. Note that you have as many consoles as databases installed, and a corresponding Windows service. We shall see at the end of this article how to disable it.

    Categories: Open Source

    Test Framework Feature Comparisons – What If We Cooperated?

    NUnit.org - Sun, 04/07/2013 - 03:14

    Software projects often publish comparisons with other projects, with which they compete. These comparisons typically have a few characteristics in common:

    • They aim at highlighting reasons why one project is superior – that is, they are marketing material.
    • While they may be accurate when initially published, competitor information is rarely updated.
    • Pure factual information is mixed with opinion, sometimes in a way that doesn’t make clear which is which.
    • Competitors don’t get much say in what is said about their projects.
    • Users can’t be sure how much to trust such comparisons.

    Of course, we’re used to it. We no longer expect the pure, unvarnished truth from software companies – no more than from drug companies, insurance companies, car salesmen or government agencies. We’re cynical.

    But one might at least hope that open source projects might do better. It’s in all our interests, and in our users’ interests, to have accurate, up-to-date, unbiased feature comparisons.

    So, what would such a comparison look like?

    • It should have accurate, up-to-date information about each project.
    • That information should be purely factual, to the extent possible. Where necessary, opinions can be expressed only if clearly identified as opinion by it’s content and placement.
    • Developers from each project should be responsible for updating their own features.
    • Developers from each project should be accountable for any misstatements that slip in.

    I think this can work because most of us in the open source world are committed to… openness. We generally value accuracy and we try to separate fact from opinion. Of course, it’s always easy to confuse one’s own strongly held beliefs with fact, but in most groups where I participate, I see such situations dealt with quite easily and with civility. Open source folks are, in fact, generally quite civil.

    So, to carry this out, I’m announcing the .NET Test Framework Feature Comparison project – ideas for better names and an acronym are welcome. I’ll provide at least a temporary home for it and set up an initial format for discussion. We’ll start with MbUnit and NUnit, but I’d like to add other frameworks to the mix as soon as volunteers are available. If you are part of a .NET test framework project and want to participate, please drop me a line.

    Categories: Open Source

    What would YOU DoInstead? The Sequel

    The Typemock Insider Blog - Thu, 04/04/2013 - 14:47

    So last time, I showed you how to do something before a method is called. That’s nice but what if you want to do something after it’s called?

    Let’s look again at the code under test:

       1: public class UserManager

       2: {

       3:     string prefix = "pre";

       4:     string suffix = "suff";

       5:  

       6:     static public int LogInCount = 0;

       7:     public bool CanUserLogIn(string user)

       8:     {

       9:         return Authenticate(prefix, user, suffix);

      10:     }

      11:  

      12:     private bool Authenticate(string prefix, string user, string suffix)

      13:     {

      14:         string fullUserName = prefix + user + suffix;

      15:         return Authenticate(fullUserName);

      16:     }

      17:  

      18:     private bool Authenticate(string fullUserName)

      19:     {

      20:         bool result = Authenticator.IsUserAuthorized(fullUserName);

      21:         if (result)

      22:             LogInCount++;

      23:         return result;

      24:     }

      25: }

     

    The API we used in our last venture is:

    callContext.WillCallOriginal();

    As you probably can guess, it’s the part that tells Isolator to run the original code. We didn’t call it in the future tense, though. The method will be executed after the code in the DoInstead clause is completed.

    In our next case, we want the Authenticate overload with 1 parameter to also run. But we want to log (and maybe even assert) the static variable LogInCounter.

    Now, we need a way to tell Isolator to invoke the method, and continue running. Let’s take a look at this test:

     

       1: [TestMethod]

       2: public void CanUserLogIn_2ndAuthenticateCalls_LoggingBeforeAndAfter()

       3: {

       4:     UserManager manager = new UserManager();

       5:  

       6:     Isolate.NonPublic.WhenCalled(manager, "Authenticate").DoInstead(

       7:         callContext =>

       8:         {

       9:             if (callContext.Parameters.Length == 3)

      10:             {

      11:                 callContext.WillCallOriginal();

      12:             }

      13:             if (callContext.Parameters.Length == 1)

      14:             {

      15:                 Console.WriteLine(@"LogInCount Before : {0}", UserManager.LogInCount);

      16:                 callContext.Method.Invoke(callContext.Instance, new object[] { callContext.Parameters[0] });

      17:                 Console.WriteLine(@"LogInCount After: {0}", UserManager.LogInCount);

      18:             }

      19:             return true;

      20:         });

      21:  

      22:     Assert.IsTrue(manager.CanUserLogIn("Valid"));

      23: }

    We see that if we call the Authenticate with 3 arguments, it will be executed once the DoInstead clause completes.

    However, when the overload with 1 argument we use another option. CallContext.Method contains the metadata of the method that’s being called. With that metadata, we can invoke it before the DoInstead completes. And we can do something after the method.

    We know that the definitive AOP example is logging. Is it useful to more than that in a testing context?

    Imagine that the Authenticator.IsUserAuthorized method might crash the system sometime. Or leave the system unclean. For our purpose, we want to run it as-is and not mock it, but when it crashes we don’t want to ruin it for the other tests.

    In this case we can do something like this:

     

       1: [TestMethod]

       2: public void CanUserLogIn_AuthenticatorCalled_WithCleanUp()

       3: {

       4:     UserManager manager = new UserManager();

       5:  

       6:     Isolate.WhenCalled(() => Authenticator.IsUserAuthorized("")).

       7:         DoInstead((callContext) =>

       8:         {

       9:             try

      10:             {

      11:                 callContext.Method.Invoke(null, new object[] { callContext.Parameters[0] });

      12:             }

      13:             catch (Exception e)

      14:             {

      15:                 // do some error handling

      16:             }

      17:             finally

      18:             {

      19:                 // do some clean up

      20:             }

      21:             return true;

      22:  

      23:         });

      24:     Assert.IsTrue(manager.CanUserLogIn("Valid"));

      25: }

     

    When the method IsUserAuthorized is called, we run it inside a try-catch-finally block, which allows us to the recovery and clean up we need when going to the next test.

    What other AOP functionalities did you ever wished you had while testing?

    Categories: Open Source

    End of Java 5 Support at Runtime for Sonar Platform

    Sonar - Wed, 03/27/2013 - 10:50

    This is it! After talking about it, internally at SonarSource, for 2 years and after a failed attempt last year, we are discontinuing the support of Java 5 runtime for the Sonar platform. Here are a few questions you might have on this:

    What does it means exactly?
    This means that you will require a JVM greater than 6 to execute Sonar Server or Sonar Analyzers. So far, these could be run also on a JVM 5.

    Can I still analyze my Java 5 project with Sonar?
    Absolutely, you will still be able to analyze your Java 5 projects the very same way.

    What is the reason for this?
    There are 2 main reasons for doing this:

    • Oracle stopped Java 5 support a long time ago and it is now time to move on for us
    • This will enable us to benefit from many libraries or versions of libraries that only support a JVM 6

    It also has nice side effects on the performances. For example, our parsers will run 20% faster when you move from Java 5 to Java 6.

    Why did we back out last year?
    We made an attempt last year, but encountered a couple of issues. The main one was that Sonar Jenkins plugin did not let you choose the JVM you want to use for the Sonar analysis – it had to be the same as the one configured for the job. This was fixed in version 2.0 of the plugin.

    Can I still execute Sonar with a JVM 5?
    You might be able to but we will only provide support if you use a JVM 6.

    Please come on the user mailing list, should you have any question or wanted to discuss this further.

    Categories: Open Source

    Curious to know how we picked speakers for the 2013 SeConf? Read on…

    Selenium - Mon, 03/25/2013 - 21:31

    This is a guest post by Marcus Merrell, one of the organizers of the 2013 Selenium Conference

    Selenium/Webdriver has kept my family fed since 2007. Since I’ve never committed a line of code to this magical project, I thought the least I could do was spend a few hours helping put SeConf 2013 together. When they asked for a volunteer to put the speaker program together, I was thrilled to step forward!

    Ultimately, I decided on a more conventional approach than straight-up dictatorship–and I can only credit the 5 awesome people on the committee and their ruthless adherence to the principle that “data wins”. I wanted a mix of hard-core browser techs, language-binding mavens, and people who ultimately made their living keeping a large variety of clients happy. And Simon–always Simon. I left myself out of the voting, because these are the experts’ experts: I figured the best thing I could do was ensure a smooth process and remove the burdens of book-keeping.

    Here they are, the People You Can Blame:

    - Dave Hunt, Mozilla
    - Jim Evans, Salesforce.com
    - Santiago Suarez-Ordoñez, Sauce Labs
    - Jari Bakken, The Matrix
    - Simon Stewart, Mt Olympus

    I don’t know if it was beginner’s luck, but there was zero drama. These folks are all pros, and we’ve put together a hell of a great conference for Boston.

    We had 24 slots to fill, but only ~45 submissions, and without the variety of topics we wanted. Specifically, we were dismayed by the low number of submissions from female presenters. Given a high proportion of female testers in the industry, we believed their voice was under-represented. The call was extended in part to attempt to correct this, and ended up netting us ~20 more submissions in total.

    With the proposals all gathered in one place (thanks, Ashley!), I then set about trying to find “themes” in the submissions. Several leapt out immediately–lots of case studies showed up from large household-name companies that I knew people would find interesting. Some deep-dives appeared, describing the inner workings of browser implementations or talking about a new tool-set people might find interesting.

    Another theme I saw, a blend of the previous two, were the Best Practices–people who wanted to talk about processes for applying disparate tool sets to the problems we face every day. I believe these talks have the broadest appeal, and are a primary driver of attendance. We also had enough mobile offerings to put together a “bloc”, which will consume a whole afternoon.

    Simon suggested “blind auditions” for the selection process, and everyone loved the idea. Voting would take place not knowing anything about the speaker outside of hints left in their abstract. Since we had extended the call to invite submissions from female presenters, we therefore believed this would “correct” for that bias. It should at least remove all doubt that any speaker was chosen specifically for their gender.

    I created a Google spreadsheet with a separate tab for each of these themes. Each tab contained only a few columns–the title, abstract, “notes to organizers” (if it was relevant), and one column for each person on the committee to vote. I did not include author bios, and if someone’s name showed up in anywhere else, I redacted it. I *did*, however, leave in speaker’s company. I figured if I saw two talks, “Success and Failure at Google” and, “Continuous Integration with Selenium at Bob’s House of HTML and Gumbo”, it would be completely reasonable to make the decision based on the company.

    My thinking was, rather than have each person go through each talk individually, all these folks would have to do is read a paragraph and assign a number 1-5 (1=want, 5=don’t want). That way they would rank the talks in terms of the best subjects for that particular theme, thereby making sure just about anyone would have a good “path” through the conference. The committee was given a short deadline (1 week!) to fill out the voting columns, after which we’d sync up on the phone.

    Somehow we managed to get people from California, Texas, Florida, the UK, and Norway into the same Google Hangout at the same time. We averaged the scores into a column in the spreadsheet, and Simon expertly sorted, manipulated, and color-coded the rows. As I said, we had 24 slots to fill, so Simon just drew a line: every talk in every theme that scored below a 2 was “in”. This left us with around 10 talks–we all agreed on two points: a) those talks were awesome, and b) we needed more.

    So we cut in the talks with a score between 2 and 3. This put us up to 23 talks, so we had to begin some horse-trading. We started to have some difficult conversations when I realized that I had somehow not scored one talk at the bottom of one tab. I applied the formula to that cell, and it had one of the best scores of all–so we had 24! Huzzah!

    Where does this leave us? With 2 days of Track A and one day of Track B. Given 8 presentations per track per day, that leaves us with an entire day of “open” talks for Track B. Be sure to sign up right when you get there–these slots went really fast last year, and will probably go fast again. We also will have a day of workshops on four different topics, with two in the morning and two in the afternoon.

    We’d like people’s feedback on how the conference “flows” this year. As I said, we wanted someone with just about any background and interest to be able to find a path through this conference, so I’d like to hear whether or not we achieved it.

    …and I hope to see you all in Boston! (PS: Tickets are going fast!).


    Categories: Open Source

    Coming to GDC? Join us for a Jenkins Drink-Up at 21st Amendment

    If you are coming to Game Developers Conference in the week of 25th, or if you are local to San Francisco bay area, come join us to the small drink up in the evening of 26th at 21st amendment.

    If you are coming, please RSVP so that we know how many to expect, and we can stay connected.

    Categories: Open Source

    New Ivonna V3.1 – Testing async requests, mocking async methods

    The Typemock Insider Blog - Tue, 03/12/2013 - 14:02

    BY ARTEM SMIRNOV

    For those of you who can’t wait to start testing async requests, here’s the good news (and no, there are no bad news in this post): starting with the 3.1 version of Ivonna, you can test them with the same syntax as before, i.e. using either session.Get(url) or session.GetPage(url).

    However, this is not the end of the story. Most of the time you use the async pattern for a reason. You have a lengthy operation in your Web code. And that’s the other good news: now you can mock async methods called from your controllers/codebehind/whetever, returning custom values. This functionality is a part of the Ivonna.Framework.MVC assembly, but you can use it with any Web framework — it’s not really related to MVC, but I didn’t put it into Ivonna itself since I didn’t want to introduce the .Net 4.0 dependency (this might change in the future).

    Suppose you have the following code that you want to test (taken from MSDN):

     

       1: public async Task<ActionResult> About() {

       2:     var client = new HttpClient();

       3:     string urlContents = await client.GetStringAsync("http://msdn.microsoft.com");

       4:     return Content(urlContents);

       5: }

     

    You can test the whole method, but the test would have wait for the HttpClient to return the result, which can take a long time, and be unpredictable. In addition, you might want to test your controller’s logic, not the code that runs the MSDN site. So, you want a predictable return value, and you want it fast. Here is how the new functionality helps you:

     

       1: var session = new TestSession();

       2: var fakeResponseString = "We Are Microsoft";

       3: session.Stub<HttpClient>("GetStringAsync").ReturnFromAsync(fakeResponseString);

     

    There’s also a strongly typed lambda-based overload, but personally I find it less convenient and more noisy. Note that a stub like this works on all requests for all instances of HttpClient, so if you want a more fine grained control, you’ll have to implement your own CThru aspect.

    One more gotcha here. Some useful async methods are implemented as extensions, so you cannot use the syntax above. Use more verbose session.AddAspect(new Stub(..)) instead.

     

    I really hope you’ll find these new features useful. Enjoy!

     

    P.S. I strongly suggest that you use this opportunity to save 16% on Ivonna and Isolator (ends March 31st).

    Categories: Open Source

    What would YOU DoInstead?

    The Typemock Insider Blog - Mon, 03/04/2013 - 14:25

    I often describe DoInstead as the 10lb/kg hammer to change behavior – if all fails, and any other API doesn’t help use it.

    I want to give you a couple of examples on different occasions where using DoInstead can be helpful, above and beyond the call of duty. Let’s start with the class we’ll work on. This class is called UserManager and handles log-ins.

     

       1: public class UserManager

       2: {

       3:     string prefix = "pre";

       4:     string suffix = "suff";

       5:  

       6:     

       7:     public bool CanUserLogIn(string user)

       8:     {

       9:         return Authenticate(prefix, user, suffix);

      10:     }

      11:  

      12:     private bool Authenticate(string prefix, string user, string suffix)

      13:     {

      14:         string fullUserName = prefix + user + suffix;

      15:         return Authenticate(fullUserName);

      16:     }

      17:  

      18:     private bool Authenticate(string fullUserName)

      19:     {

      20:         bool result = Authenticator.IsUserAuthorized(fullUserName);

      21:         

      22:             

      23:         return result;

      24:     }

      25: }

    As you can see, it has an overloaded Authenticate private method, both called by the public method.

    For our first test, I’d like to call the real Authenticate method with the 3 arguments, but fake the internal with the single argument.Not that if the methods were’ public, this wans’t a real issue, since the public API lets you specify the exact overload. With non-public methods, we need to get creative.

     

       1: [TestMethod]

       2: public void CanUserLogIn_2ndAuthenticateCallFaked()

       3: {

       4:     UserManager manager = new UserManager();

       5:  

       6:     Isolate.NonPublic.WhenCalled(manager, "Authenticate").DoInstead(

       7:         callContext =>

       8:         {

       9:             if (callContext.Parameters.Length == 3)

      10:             {

      11:                 callContext.WillCallOriginal();

      12:                 return true;

      13:             }

      14:             return false;

      15:         });

      16:  

      17:     Assert.IsFalse(manager.CanUserLogIn("Invalid"));

      18: }

    Since we’re dealing with non-public methods here, so I’m using the Isolate.NonPublic APIs. In the DoInstead clause, we can check the number of parameters. If the number of parameters is 3, we’ll call the original method. Otherwise, we’ll just return a fake false value.

    What’s that WillCallOriginal thingy? It’s a new API we’ve added in Isolator version 7.3. It allows you to specify that once the DoInstead code runs, it will continue to run the original method. The return statement that follows is required for syntactic reasons, and in our case doesn’t really change anything. Don’t believe me? Debug it!

    Ok, don’t. See if I care.

    Let me show you another test to show that it actually works:

       1: [TestMethod]

       2: public void CanUserLogIn_BothCallsAreReal_LoggingBefore()

       3: {

       4:     UserManager manager = new UserManager();

       5:  

       6:     Isolate.NonPublic.WhenCalled(manager, "Authenticate").DoInstead(

       7:         callContext =>

       8:         {

       9:             if (callContext.Parameters.Length == 3)

      10:             {

      11:                 Console.WriteLine(@"Prefix: {0}, Suffix: {1}: , User: {2}", 

      12:                     callContext.Parameters[0], callContext.Parameters[2], callContext.Parameters[1]);

      13:             }

      14:             if (callContext.Parameters.Length == 1)

      15:             {

      16:                 Console.WriteLine(@"Full Name: {0}", callContext.Parameters[0]);

      17:             }

      18:             callContext.WillCallOriginal();

      19:             return true;

      20:         });

      21:  

      22:     Assert.IsTrue(manager.CanUserLogIn("Valid"));

      23: }

     

    This time, we’re not faking anything. But we’ve added some logging just before the actual methods run. It’s a different method of logging, since each overload looks different. Using DoInstead here doesn’t have any impact on the test, but it helps if you need some logging magic.

    It’s a bit like AOP, isn’t it? Injecting code before the actual method runs.

    But what if we need to inject code after the method runs?

    Wait for the next post to find out…

     

    Gil Zilberfeld

    Categories: Open Source

    Giveaway Week: Scandinavian Developer Conf & Agile Dev Practices Conf

    The Typemock Insider Blog - Mon, 03/04/2013 - 13:04

    We’re getting the word out that Typemock makes unit testing easier!

    All this week: March 4-7 2013 - parallel to the Agile Dev Practices Conference in Berlin and the Scandinavian Developer Conference in Gothenburg – we’ll be giving away all sorts of FREE stuff including Brian the Build Bunny, Free 1 Year Isolator Complete Licenses (valued at $1598!) and other swag.

    All you have to do to be eligible is tweet about various conference lectures using the conference hashtag (either #agiledevpract, #scandev or #SDC2013) and don’t forget to include the #Typemock hashtag as well.

    • Tweet your favorite sentence or line from any of the conference’s lectures
    • Tweet about your favorite speaker and/or lecture
    • Tweet about  something interesting that you’ve learned during the conference

    Don’t forget the hash-tags: the conference’s and #typemock!

    At the end of the each conference will give away a Brian the Build Bunny to one of our Twitter followers for the most retweeted tweet with the Typemock and conferences hashtag.

     

    Thinking of giving Unit Testing a try? Download Isolator Basic for Free here.

    Want to learn more about Unit Testing? Join Gil Zilberfeld Webinar on Real Life Unit Testing. March 12th. Register here.

     

    Categories: Open Source

    4 Warning Signs that Agile Is Declining

    The Typemock Insider Blog - Mon, 02/25/2013 - 13:06

    A post by Gil Zilberfeld

    I’ve been thinking lately about how agile turned out to be the way we know it today. And the more I think about it, I get more depressed.

    You see, agile was supposed to save us all. It was supposed to be the bridge between business and developers.

    And 10 years after its inception, we should be happy that more than half of the projects are done in agile manner (depending how you interpret the numbers). Agile has crossed the chasm, but not like we imagined it would.

    • Companies are “doing agile”. But they do it the way they implemented processes for the last 200 years: Top-down. First they train the top management. Then they move on to directors. Then to team leads. And at the end, they get to the developers. Remember that “working software” part? It looks like they didn’t read the small print (much like in the waterfall case).
    • Business and development divide has grown. Because scrum won, we now have project managers as  scrum masters. They don’t know much about software, and that doesn’t help bridge the gap between the two worlds. Developers still look at those scrum master certifications funny (with some reason on their side), and the PMs still don’t understand that in order to get to “working software”  you need to persist with actual software development practices. Because if  you don’t write tests, or refactor, your team will slow down very quickly. And that will not produce as much “working software” as it said on the side of the box.
    • It’s been just 10 years and we’re  already looking for the new hotness. We didn’t have enough time to  learn or adjust. Agile has now become “boring” and we’re looking to uncover more better ways to develop software. Those things that looked “shiny” a few years ago, like TDD or continuous integration, have lost  their shine, and aren’t attractive anymore. Don’t believe me? check out the big conferences – seen these topics lately? Much like good management is dull and repetitive, so are agile development practices. But while we  appreciate the old ways, apparently we value the new stuff more (without any good reason).
    • We can’t even appear as a united front.  We’re bickering inside ourselves. Agile vs kanban, craftsmen vs non-craftsmen – you’re doing it wrong, we hear from every side. And since  agile has now become mainstream, it has a lot of money pouring in, and the side (read: consultants and trainers) that shout the loudest get a piece of the pie.

    At this point, I feel Agile is declining into what TQM was. A brilliant success in the beginning, and now just a history fact. In a few years, months even, the business side will wake up and say: Agile is snake oil. It doesn’t deliver on its promise (and it doesn’t matter if it’s done wrong). The backlash will be grand.

    There is still some light at the end of the tunnel: Regardless of our role in the process, as long as we’re delivering working software, we’re contributing to balance this future backlash. As long as we stick to the original agile ideas, we’re helping agile win a few more hearts.

    I hope our collective work will be enough, that results will prevail. But I fear we’re seeing the beginning of the end.

    Don’t agree? Cheer me up in the comments!

    I invite you to register to my free webinar on “Agile Tribal Wars – Modern-day Quest for the Holy Grail

     

    Categories: Open Source