Pex4Fun Challenges and Test Driven Development


So how could you use Pex4Fun (Windows phone app) or PexforFun web app in your curricula?

The (RiSE) team has created these great tool to exercise your students brains, they help teach and reinforce the bit of code your delivering in lectures and allow them to learn self paced.

As I have stated in the previous blog you have two ways of using Pex. For the web version simply go to the PexForFun site  or for the mobile version install the Pex4Fun app onto your Windows Phone device.

So what is available?

There are puzzles, learning exercises, and duels. Register and you can create your own challenges. The puzzle structure is a great demonstration of Pex. When you start a new puzzle, you have a empty implementation. You can click Ask Pex to get some test results on the hidden successful implementation. Pex then executes those tests on your code.


Students will learn as they see some failures, and you can fix your code to make the tests pass. Student can click “Ask Pex” to see if a more extensive test suite still passes. Iterating this way not only helps students understand fundamentals but also enables them to write better code and its tested to see if their implementation gets closer to the expected solution. If you are not familiar with Test Driven Development, this is a great tools for teaching the concept.

All in all, there are several reasons you should consider integrating FREE resource like PexForFun into your curricula or vocational training resources:

  1. It is ideal to get students aware of and practicing Test Driven Development. you start with an empty implementation, and see a few failing tests. Keep making a few pass and you’ll get more tests. After a few iterations you’ll have everything working.
  2. It will give students practice writing tests. Pex generates tests by analysing their code. It determines a number of interesting inputs to code by analysing its structure. You can read an overview here By seeing the inputs it chooses, The outcome is that students get ideas and real understanding of how to write their own tests. By thinking about inputs it chooses to ignore, students can get better at writing useful concise tests instead of simply creating more tests.
  3. Plex helps exercises students brains and refreshes that to principles and concepts. The puzzles range from introductory to rather complicated.
  4. It support multiple languages C#, VB and F#.
Comments (0)

Skip to main content