Week 11 [Mon, Oct 28th] - Topics

Detailed Table of Contents



Guidance for the item(s) below:

Earlier, you learned the basic notation used in sequence diagrams. Now, let's learn some intermediate notation.

[W11.1] Sequence Diagrams: Intermediate

W11.1a

Design → Modelling → Modelling Behaviors → Sequence diagrams - intermediate

Video

Can draw intermediate-level sequence diagrams

UML Sequence Diagrams → Object Deletion

Loading...

UML Sequence Diagrams → Self-Invocation

Loading...

UML Sequence Diagrams → Alternative Paths

Loading...

UML Sequence Diagrams → Optional Paths

Loading...

UML Sequence Diagrams → Calls to Static Methods

Loading...


Exercises:

What’s going on here?


Explain Sequence Diagram (ParserFactory)


Draw Sequence Diagram for printing a quote




Follow up notes for the item(s) above:

Here is a worked example of drawing sequence diagrams (intermediate notation) to match a code snippet.

Video Drawing sequence diagrams (intermediate) - TaskList#generateTask()

Video Drawing sequence diagrams (intermediate) - create Quote

[W11.2] More Design Patterns : OPTIONAL

W11.2a : OPTIONAL

Design → Design Patterns → MVC Pattern → What


W11.2b : OPTIONAL

Design → Design Patterns → Observer Pattern → What


W11.2c : OPTIONAL

Design → Design Patterns → Other design patterns


W11.2d : OPTIONAL

Design → Design Patterns → Combining design patterns


W11.2e : OPTIONAL

Design → Design Patterns → Using design patterns


W11.2f : OPTIONAL

Design → Design Patterns → Design patterns versus design principles


W11.2g : OPTIONAL

Design → Design Patterns → Other types of patterns



Guidance for the item(s) below:

Streams is an advanced Java feature not required for this course. If you are still interest to learn it, some resources are given below.

[W11.3] Java: Streams : OPTIONAL

W11.3a : OPTIONAL

C++ to Java → Miscellaneous Topics → Streams: Basic



Guidance for the item(s) below:

JavaFX is not required for this course. If you are still interest to learn JavaFX, given below is a link to some tutorials.

[W11.4] Java: JavaFX : OPTIONAL

W11.4a : OPTIONAL

C++ to Java → Miscellaneous Topics → JavaFX



Guidance for the item(s) below:

At some point, you want to package your code as a single executable file. The next topic covers how to do that.

[W11.5] Java: JAR Files

W11.5a

C++ to Java → Miscellaneous Topics → Using JAR files

Can use JAR files

Java applications are typically delivered as JAR (short for Java Archive) files. A JAR contains Java classes and other resources (icons, media files, etc.).

An executable JAR file can be launched using the java -jar command e.g., java -jar foo.jar launches the foo.jar file.

The IDE or build tools such as Gradle can help you to package your application as a JAR file.

See the tutorial Working with JAR files @se-edu/guides to learn how to create and use JAR files.



Guidance for the item(s) below:

You've already been doing some testing in your project work. It turns out there are many ways to categorize testing. Let's learn some of the more common categorizations of testing.

[W11.6] Testing: Types


Integration Testing

W11.6a

Quality Assurance → Testing → Integration Testing → What

Video

Can explain integration testing

Integration testing : testing whether different parts of the software work together (i.e. integrates) as expected. Integration tests aim to discover bugs in the 'glue code' related to how components interact with each other. These bugs are often the result of misunderstanding what the parts are supposed to do vs what the parts are actually doing.

Suppose a class Car uses classes Engine and Wheel. If the Car class assumed a Wheel can support a speed of up to 200 mph but the actual Wheel can only support a speed of up to 150 mph, it is the integration test that is supposed to uncover this discrepancy.


W11.6b : OPTIONAL

Quality Assurance → Testing → Integration Testing → How



System Testing

W11.6c

Quality Assurance → Testing → System Testing → What

Can explain system testing

System testing: take the whole system and test it against the system specification.

System testing is typically done by a testing team (also called a QA team).

System test cases are based on the specified external behavior of the system. Sometimes, system tests go beyond the bounds defined in the specification. This is useful when testing that the system fails 'gracefully' when pushed beyond its limits.

Suppose the SUT is a browser that is supposedly capable of handling web pages containing up to 5000 characters. Given below is a test case to test if the SUT fails gracefully if pushed beyond its limits.

Test case: load a web page that is too big
* Input: loads a web page containing more than 5000 characters.
* Expected behavior: aborts the loading of the page
  and shows a meaningful error message.

This test case would fail if the browser attempted to load the large file anyway and crashed.

System testing includes testing against non-functional requirements too. Here are some examples:

  • Performance testing – to ensure the system responds quickly.
  • Load testing (also called stress testing or scalability testing) – to ensure the system can work under heavy load.
  • Security testing – to test how secure the system is.
  • Compatibility testing, interoperability testing – to check whether the system can work with other systems.
  • Usability testing – to test how easy it is to use the system.
  • Portability testing – to test whether the system works on different platforms.


Acceptance Testing

W11.6d

Quality Assurance → Testing → Acceptance Testing → What

Can explain acceptance testing

Acceptance testing (aka User Acceptance Testing (UAT): test the system to ensure it meets the user requirements.

Acceptance tests give an assurance to the customer that the system does what it is intended to do. Acceptance test cases are often defined at the beginning of the project, usually based on the use case specification. Successful completion of UAT is often a prerequisite to the project sign-off.


W11.6e

Quality Assurance → Testing → Acceptance Testing → Acceptance versus system testing

Video

Can explain the differences between system testing and acceptance testing

Acceptance testing comes after system testing. Similar to system testing, acceptance testing involves testing the whole system.

Some differences between system testing and acceptance testing:

System Testing Acceptance Testing
Done against the system specification Done against the requirements specification
Done by testers of the project team Done by a team that represents the customer
Done on the development environment or a test bed Done on the deployment site or on a close simulation of the deployment site
Both negative and positive test cases More focus on positive test cases

Note: negative test cases: cases where the SUT is not expected to work normally e.g. incorrect inputs; positive test cases: cases where the SUT is expected to work normally

Requirement specification versus system specification

The requirement specification need not be the same as the system specification. Some example differences:

Requirements specification System specification
limited to how the system behaves in normal working conditions can also include details on how it will fail gracefully when pushed beyond limits, how to recover, etc. specification
written in terms of problems that need to be solved (e.g. provide a method to locate an email quickly) written in terms of how the system solves those problems (e.g. explain the email search feature)
specifies the interface available for intended end-users could contain additional APIs not available for end-users (for the use of developers/testers)

However, in many cases one document serves as both a requirement specification and a system specification.

Passing system tests does not necessarily mean passing acceptance testing. Some examples:

  • The system might work on the testbed environments but might not work the same way in the deployment environment, due to subtle differences between the two environments.
  • The system might conform to the system specification but could fail to solve the problem it was supposed to solve for the user, due to flaws in the system design.

Exercises:

Statements about system testing and acceptance testing




Alpha/Beta Testing

W11.6f

Quality Assurance → Testing → Alpha/Beta Testing → What

Can explain alpha and beta testing

Alpha testing is performed by the users, under controlled conditions set by the software development team.

Beta testing is performed by a selected subset of target users of the system in their natural work setting.

An open beta release is the release of not-yet-production-quality-but-almost-there software to the general population. For example, Google’s Gmail was in 'beta' for many years before the label was finally removed.



[W11.7] Testing: Intermediate Concepts : OPTIONAL


Dependency Injection

Video

W11.7a : OPTIONAL

Quality Assurance → Testing → Dependency Injection → What


W11.7b : OPTIONAL

Quality Assurance → Testing → Dependency Injection → How



Testability

W11.7c : OPTIONAL

Quality Assurance → Testing → Introduction → Testability



Test Coverage

Video

W11.7d : OPTIONAL

Quality Assurance → Testing → Test Coverage → What


W11.7e : OPTIONAL

Quality Assurance → Testing → Test Coverage → How



TDD

Video

W11.7f : OPTIONAL

Quality Assurance → Testing → Test-Driven Development → What