Delv
Machinet
Getting Started Guide

How to Use Machinet

A practical guide to get you up and running with Machinet. Written by Delv Editorial, Delv Team.

Getting started with Machinet

In this guide, you'll learn how to quickly generate unit tests for your Java and Kotlin projects using Machinet. You'll be able to automate the tedious process of writing tests, allowing you to focus more on coding.

Step 1: Sign up and set up

  1. Go to Machinet's website.
  2. Click on the “Sign Up” button in the top right corner.
  3. Fill in your email address and create a password. Confirm your password and click “Create Account.”
  4. Check your email for a verification link and click it to activate your account.
  5. Log in to your account.

Step 2: Your first unit test

  1. Once logged in, navigate to the “Dashboard.”
  2. Click on “New Project” and enter your project details (name, language, etc.).
  3. Upload your Java or Kotlin source files by clicking the “Upload Files” button.
  4. After uploading, click on the “Generate Tests” button. This will prompt Machinet to analyse your code.
  5. After a moment, you’ll see a list of generated tests. Review them for accuracy.
  6. Click “Download Tests” to save the generated JUnit or Mockito tests to your local machine.

Step 3: Get better results

  1. Ensure your code follows the Given-When-Then style to help Machinet generate more relevant tests.
  2. Use meaningful method names and comments in your code to guide the AI.
  3. After generating tests, run them in your IDE to see if they pass, and adjust your code as necessary.

Pro tip

Take advantage of the “Preview” option after generating tests. This allows you to tweak the generated code before downloading, saving you from having to edit it later.

Common mistake to avoid

Avoid uploading incomplete or poorly structured code. If your code lacks clarity, Machinet may generate irrelevant or ineffective tests. Always ensure your code is well-organised and fully functional before running test generation.