Please stay healthy!

Remote Lectures

All Meetings

Schedule here:


Can we run applications with a GUI?

Can a docker run a windows application on linux?

Like this Virtual Machine..

Docker containers can run anywhere, on-premises in the customer datacenter, in an external service provider or in the cloud, on Azure. Docker image containers can run natively on Linux and Windows.

However, Windows images can run only on Windows hosts and Linux images can run on Linux hosts and Windows hosts (using a Hyper-V Linux VM, so far), where host means a server or a VM.

Container kernel needs to match host kernel.

Host System


Host System




Now that Docker uses libcontainer rather than LXC as its basis, it is possible that porting of libcontainer in the future could one day allow for running Windows and Mac OS Docker containers on those systems respectively, but it would depend on appropriate OS features being available to allow for containerization.

So why is Docker cool?

much more lightweight than VirtualMachines

Virtual Machines


So why is Docker cool?

runs on cloud services

So why is Docker cool?

it can scale!

Container Orchestration

Run many containers on a cluster


Docker Swarm




Now back to our Dockerfile...

1. Create                   repository and clone it.

2. Add C++ code.

3. Create                  Dockerfile.

4. Build and tag Docker container.

5. Push container to                        !

6. Modify C++ code.

7. And see what happens...

FROM ubuntu:18.04

MAINTAINER Daniel Haehn version: 0.1


RUN apt-get update
RUN apt-get install -y g++
RUN g++ -o converter

ENTRYPOINT ["./converter"]


Functions, Classes

Arrays, Vectors


GIBBS Cluster


Run our C++ code in Python using Cython

and compare timing against NumPy

Analyze a bunch of numbers and calculate min, max, mean, stddev.

Now: Testing

Testing means checking code for bugs..

STEAMROOT="$(cd "${0%/*}" && echo $PWD)"

# Scary!
rm -rf "$STEAMROOT/"*

This could fail: produce an empty string!

rm -rf /

Testing means checking code for bugs..

Manual Testing

Automatic Testing

Explanatory Testing

Unit Testing

Chapters 7, 8, 9

Integration Testing

System Testing

System Tests

Testing Pyramid

Unit Tests

test individual functions

def inc(x):
    return x + 1
def test_inc():
    assert inc(4) == 5
def test_inc3():
    assert inc('a') == 'b'
def test_inc2():
    assert inc(-1) == 0

throws exceptions

def test_inc4():
    assert inc('a') == 'a1'
# assert(a == b)

if not a==b:
  throw Error()
import sys

def inc(x):
    return x+1
largestInt = sys.maxint

print ( largestInt )

print ( inc( largestInt ) )

Test Driven Development


Tests should be FAST

Tests should be INDEPENDENT

Tests should be REPEATABLE

Tests should be SELF-VALIDATING

True or False

Tests should be written in a TIMELY fashion

Pages 132/133

Integration Testing

def test_some_method(parameter):

  # return true or false
def test_setup():

  # connect to database
  # or span server
def test_teardown():

  # delete temporary files
  # or close database connection

1. Setup

2. Test

3. Teardown


$ pytest
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
collected 1 item F                                                     [100%]

================================= FAILURES =================================
_______________________________ test_answer ________________________________

    def test_answer():
>       assert inc(3) == 5
E       assert 4 == 5
E        +  where 4 = inc(3) AssertionError
========================= short test summary info ==========================
FAILED - assert 4 == 5
============================ 1 failed in 0.12s =============================
# content of
def inc(x):
    return x + 1

def test_answer():
    assert inc(3) == 5

System Testing

Test of the full product

End-to-end Testing

Blackbox Testing

Whitebox Testing


Externals without knowledge

about what is going on inside

UI Testing

from selenium import webdriver

def test_google():
  driver = webdriver.Chrome()

  searchtext = driver.find_element_by_id("searchtext")
  submitbutton = driver.find_element_by_id("submit")

UI Testing

Control a web-browser

CS410 Lecture 22

By Daniel Haehn

CS410 Lecture 22

Slides for CS410 Software Engineering at UMass Boston. See!

  • 312