Article
· 8 hr ago 2m read

Implemented ideas: Add a project that helps to generate unittests for an ObjectScript class

This article is part of a series showcasing the implementation of ideas from the Ideas Portal, where innovative concepts come to life!

Many InterSystems IRIS developers frequently need to create unit tests for ObjectScript classes — a process often done manually. The iris-tripleslash application revolutionizes this by automatically generating unit test classes with test methods for all the class methods of the original class. Developed by the talented Musketeers team @José Pereira, @Henrique Dias, @Henry Pereira — this tool was inspired by an idea shared by @Evgeny Shvarov on the Ideas Portal: "Add a project that helps to generate unittests for an ObjectScript class".

 

The creators of iris-tripleslash have simplified and enhanced the testing process. By generating tests directly from code examples found in method descriptions, TripleSlash not only improves class documentation but also streamlines test automation. For more details and a hands-on example, check out the article iris-tripleslash - let's rock together!

Many thanks to @Henry Pereira for sharing insights into the implementation process! He shared that the most challenging part of any programming contest is coming up with an interesting idea. Luckily, teamwork made this process easier for the Musketeers (credit goes to @Evgeny Shvarov for suggesting the name 😉). Inspired by the triple slash comment syntax and Elixir's DocTest, which uses comments to test code, they tackled the challenge of creating a parser to transform comments into tests — a task that felt like solving a complex puzzle!

Reflecting on their work, the team believes they could enhance the process by executing tests directly in %UnitTest.TestCase rather than creating a separate test class, making the solution even faster and more efficient.

The iris-tripleslash application has been widely recognized:

  • 1st place award in the Development Contest.
  • 5-star rating on Open Exchange, with 370 views.
  • Positive reviews, including feedback from @Gabriel Schiehl (“unit tests worked correctly”) and Developer Community legend @Robert Cemper (“works ok, it’s complete”).

Additionally, there are eight articles on Developer Community dedicated to this application, including content in English, French, Spanish, and Portuguese, as well as a top-grossing video announcement. While the video may include humor, the application is a serious and powerful tool.


We’d love to hear your thoughts about the iris-tripleslash application and the idea behind it. Share your feedback in the comments, and don’t forget to:

  • Post your own ideas.
  • Vote and comment on existing ideas.
  • Take inspiration from the Community Opportunity ideas and bring them to life!

Let’s continue to innovate and build together!

Discussion (0)1
Log in or sign up to continue