Model Based Testing a 3D game engine

10
Rasmus Møller Selsmark Team Lead, Infrastructure [email protected] Model Based Testing a 3D game engine

Transcript of Model Based Testing a 3D game engine

Rasmus Møller SelsmarkTeam Lead, [email protected]

Model Based Testinga 3D game engine

2

Simple game object physics

3

Model Actions

● SetMass (float)

Sets mass of rigid body. Higher mass requires higher force to move it.

● AddForce (vector, mode)

Adds specified force (vector) to object, in order to make it move.

4

Force Modes

● ForceAdd a continuous force to the rigidbody, using its mass.

● AccelerationAdd a continuous acceleration to the rigidbody, ignoring its mass.

● ImpulseAdd an instant force impulse to the rigidbody, using its mass.

● VelocityChangeAdd an instant velocity change to the rigidbody, ignoring its mass.

5

A Basic Physics Model

6

Model Implementation using Spec Explorer

7

Limiting the Model Outcome State Space

8

Unity Runtime Test Framework

Test Case

plus more ...

Runtime PlayersRuntime Players

Runtime Test Framework

9

Connecting the Model and Framework

Model /Spec Explorer

Runtime Test Framework UnityRuntime

C# Unit Test Code Runtime Test Code

10

Connecting the Model and Framework - solution

● Spec Explorer generates C# unit tests

● Runtime Test Framework requires one class per test case

● Dynamic code generation from model generated test cases