Product Update - Unit testing 4 key functions
In this 3 minutes video we share with you some examples of the recent improvements of our AI by opening the Ponicode interface on 4 functions. We hope the specificity with which Ponicode can suggests inputs and the accuracy of our generated test file will change your code quality journey.
First example takes a client as an input, as you can see the client has 3 arguments jobtype title and streetname. We can use Ponicode to test this function. As you can see Ponicode was able to reconstruct the object with the right structure and we can see that each leaf has the right type of value - jobtype is a jobtype, streetname is a streetname and title is a title. These are very natural values that can be taken for these keys.
We can see that Ponicode can be as efficient for objects. The following function takes an object amongst other types of inputs. The strength of Ponicode is to be consistent no matter the number and diversity of parameters. Here we have 4 parameters and Ponicode is capable of suggesting natural values thanks to the AI engine. The date is a date timezone is a timezoe and company name is accurate examples.
Here is a function with a switch condition structure. Ponicode understand the 4 conditions and it can suggest values for each scenario. It does not stop here. Ponicode is capable to suggest accurate values for each condition as well as out of the scope suggestions so you can cover all the scenarios.
Last but not least the function get and validate department has 2 arguments; lang contraction of language and args which is a very nested object. It is very interesting to see how the AI understands the context within the function. It can replicate the structure of the nested object and provide natural values for each and every leaf. The arg object is very deep here with many nested leaves but this is no obstacle to our AI.
Since we have created our AI in 2019 we have trained it on millions of lines of code and we keep improving its capacity to recognize and handle complex functions.
It’s now your turn to play with our AI engine, run it on your projects and accelerate your code quality strategy today.
Your feedback is key to our success so don’t hesitate to reach out to the team and the Ponicode community on our Ponicode Slack. Otherwise we are regularly publishing new tutorials to show you how Ponicode can boost your unit tests for a wide diversity of functions and different frameworks so go explore our youtube resource center and subscribe to get notified of our next videos.