Skip to content

Testplan

JVerbruggen edited this page Jan 11, 2021 · 6 revisions

All of the following in scope classes (except InstanceManager) are abstract and should be implemented. This test plan covers these abstract classes as a suggestion for testing the implementations.

In scope

  • InstanceManager
  • InstanceSupplier
  • MappingSelector
  • Mapping
  • Factory
  • ItemManager

Out of scope

  • UUIDObjectManager - No suggestion, these managers have no expected logic

Types

  • Unit tests

Functional Requirements

ID Description
FR1.1 Adding an InstanceSupplier to the InstanceManager.
FR1.2 Get an InstanceSupplier from the InstanceManager.
FR1.3 Get a Singleton InstanceSupplier from the InstanceManager.
FR2.1 Adding a MappingSelector to the InstanceManager.
FR2.2 Get a MappingSelector from the InstanceManager.
FR2.3 Map one type to another with a Mapping.
FR2.4 MappingSelector should return the correct Mapping, depending on clauses.
FR3.1 Adding a Factory to the InstanceManager.
FR3.2 Get a Factory from the InstanceManager.
FR3.3 Create an instance of a certain object type with a Factory.
FR4.1 Registering item to ItemManager
FR4.2 Get all items previously registered to ItemManager

Risks

  • Damage: least-most 1-3
  • Risk of failure: least-most 1-3
  • Overall risk: Damage * Failure
  • Class of seriousness: A = critical, B = High, C = Low
ID Damage Risk of failure Overall risk Class of seriousness
FR1.1 3 1 3 B
FR1.2 3 1 3 B
FR1.3 3 1 3 B
FR2.1 3 1 3 B
FR2.2 3 1 3 B
FR2.3 3 1 3 B
FR3.1 3 1 3 B
FR3.2 3 1 3 B
FR3.3 3 1 3 B
FR4.1 3 1 3 B
FR4.2 3 1 3 B

All abstract components are equally important. If any of them fail it causes all implementations to fail, although this is very unlikely.

Strategy

PRA stands for Product Risk Analysis. The amount of stars indicates the test's relative importance.

ID PRA Unit
FR1.1 B *
FR1.2 B *
FR1.3 B *
FR2.1 B *
FR2.2 B *
FR2.3 B *
FR3.1 B *
FR3.2 B *
FR3.3 B *
FR4.1 B *
FR4.2 B *

All abstract components are equally tested using unit tests. Only the implementations can be tested by integration tests or system tests.

Test cases

ID Description Expected result
TC1.1-2 1. Create new InstanceSupplier.
2. Register InstanceSupplier to InstanceManager.
3. Request InstanceSupplier from InstanceManager.
4. Compare both InstanceSuppliers.
Source and returned InstanceSupplier should be identical.
TC1.3 1. Request Singleton of any type from InstanceSupplier.
2. Request same again.
3. Compare results.
Both returned instances should be identical.
TC2.1-2 1. Create new MappingSelector.
2. Register MappingSelector to InstanceManager.
3. Request MappingSelector from InstanceManager.
4. Compare both MappingSelector.
Source and returned MappingSelector should be identical.
TC2.3 1. Create an instance of type A.
2. Create an instance of type B that's the equivalent of type A.
3. Create a Mapping with types A and B.
4. Map the instance of type A with the Mapping.
5. Compare the instance from step 2 with the instance returned from the Mapping.
Instances should be equal.
TC2.4 1. Create an instance of type A.
2. Create expected Mapping independently.
3. Request Mapping from MappingSelector given type A.
4. Evaluate expected Mapping with requested Mapping.
Mappings should be equal.
TC3.1-2 1. Create new Factory
2. Register Factory to InstanceManager
3. Request Factory from InstanceManager
4. Compare both Factory.
Source and returned Factory should be identical.
TC3.3 1. Create a new Factory with type A.
2. Create the expected instance of type A.
3. Create an instance of type A with the Factory.
4. Evaluate if the returned instance.
Expected and returned instances should be equal.
TC4.1-2 1. Create an instance of type A.
2. Create an ItemManager that manages type A.
3. Register the created instance to the ItemManager.
4. Request all saved items from the ItemManager.
Returned saved items should contain the instance of type A.

Test coverage

Coverage FR1.1 FR1.2 FR1.3 FR2.1 FR2.2 FR2.3 FR2.4 FR3.1 FR3.2 FR3.3 FR4.1 FR4.2
TC1.1-2 x x
TC1.3 x
TC2.1-2 x x
TC2.3 x
TC2.4 x
TC3.1-2 x x
TC3.3 x
TC4.1-2 x x

Test execution

Unit tests should be executed using GitHub or GitLab pipeline. Failed tests should block pull requests from merging until resolved.

Clone this wiki locally