
A unit test is an automated test that tests a single functional unit of a program in isolation. Isolated means: without a database, without a network, without other parts of the program. The test calls a method or function with defined inputs and checks whether the result matches the expected value.
Good unit tests run automatically at the push of a button, independently of one another, and each test precisely one property. They are usually written alongside production code, sometimes even before it. This sequence is called test-driven development and forces the developer to think about the desired behaviour before implementation. The real benefit becomes apparent later: anyone refactoring a function immediately notices if they have broken something in the process. Without these tests, "broken" often remains undiscovered until the next customer call. A failing unit test should also immediately show which single function is affected, instead of sending the developer on a hunt for errors through the entire application. If such tests are missing, testing usually shifts to manual click testing by a human, which works somehow, but has to be repeated from scratch every single time.
Unit tests appear less frequently in SAP Business One development than in classical web development because a lot of logic is located in form events rather than in isolated functions.
Demarcation
A unit test checks a single unit in isolation. An integration test checks whether multiple units interact correctly, such as a function together with the real database. An end-to-end test goes even further and checks the complete workflow from the user's perspective, from the input form to the saved receipt. All three types of test complement each other. Anyone who only writes unit tests has many tested individual parts and still no guarantee that they work together. A clean set of all three levels nevertheless remains the exception, not the rule.
SAP B1 10.0 FP2608: Service Layer AI as a transactional layer
Process Reward Models: Why a correct result does not yet prove a correct method
Test-Time Compute Scaling: Why a Smaller AI Model Can End Up Winning — and What Supplier Comparison in SAP Business One Has to Do With It
RLHF and reward models: AI hype or what the approval process in SAP Business One has to do with it
AI – Answers from SAP Business One – without SQL, without IT ticket