1 of 39

2/5/2019

Survey Results, Unit Testing

2 of 39

Agenda

  • Attendance
  • ARTICLES.md
  • Course Feedback / Notes
  • Survey Results - Students
  • Survey Results - Industry Leaders
  • Unit Tests
  • Project 4 - FizzBuzzBazz + Unit Test

3 of 39

Attendance

4 of 39

ARTICLES.md

Open PRs tagged as an article

merged this morning- https://github.com/sleddog/methods/pull/51

...The best GitHub repos in December 2018...

  • we use the Ant UI library at Figure - DEMO

5 of 39

Course Feedback / Notes

Reminder to use Course Notes document

grades for Project 1 online in D2L

grades for Project 2, 3 posted by next week

sleddog/methods

  • switching away from forks
  • invited you all as collaborators

Started our LinkedIn Group

6 of 39

7 of 39

No Linkedin Profile...

John Watts

Scott Neuville

Gage O'Neill

Nick Hager

Alex Sutherland

8 of 39

9 of 39

Favorite Language?

10 of 39

Student Survey Results

“...Git, Development methodologies...”

“...gain valuable insights into the industry to better prepare me for internships/jobs...”

“...interested in docker, git, and unit tests...”

“...continuous integration, authentication, docker/kubernetes, testing (unit and stress/load?)...”

11 of 39

Student Survey Results

“... help me add value when I join a company. I want to focus on industry methods that are ignored in the typical CS classes...”

“...git and code review...”

“...get really familiar with git...”

GitHub”

“Control Flow, IDE Setup, and connecting the dots between school/real world”

12 of 39

Student Survey Results

“Kubernetes, literally anything!”

“Workflow and tools used in industry”

“monitoring, code reviews, communication, unit testing, clean code, continuous integration, kubernetes”

“Tools that are used to launch and maintain live software”

Git, command line, workflow in industry, anything that will help me when I get out”

“...be comfortable with git

“Build systems”

13 of 39

“The topic of what to learn more about! I am wandering in the forest of my field!”

14 of 39

kubernetes

15 of 39

18 responses

Pulsara, Oracle, Schedulicity, Resonon, 45 North Solutions, PolSource, OnX, wolfSSL Inc., Foundant Technologies, SAP Concur, Workiva, Dataminr, CrossTx, Inc., Submittable, Quiq, Figure Technologies Inc., Kinsa Creative Incorporated, Salesforce

16 of 39

17 of 39

Version Control?

18 of 39

Cloud Providers

19 of 39

Typical Process at Workiva

1. A PR is created

2. Code reviews are required

4. A slew of automated tests run which includes Security analysis, unit/functional/integration tests as well as internal compliance checks

3. QA testing is performed

4. If everything looks good we have a Bot that lurks on github and you can request the Bot to merge the PR

20 of 39

Typical Process at Pulsara

  • Create a topic branch for your work
  • Implement feature, task, or bug fix
  • Add automated tests to cover new code
  • Submit Pull Request via GitHub to downstream branch
  • Receive code review from two other engineers
  • Fix any code review comments, until two +1
  • Merge PR

21 of 39

Typical Process at Figure

We utilize a standard git flow where features are branched from develop and merged back in. The develop branch is considered ready for production and is merged to master to complete a production release.

DEMO - jenkins + github integration

22 of 39

23 of 39

24 of 39

25 of 39

26 of 39

Advice from Industry

Please read through the entire survey results (request for access please), as there are some common themes of advice.

Next slides are the highlights...

27 of 39

Erich Hannah - CTO Pulsara

  • Be smart. Maximize your horsepower through independent study and experimentation.
  • Finish. Get projects completed all the way to Done.
  • Be curious. Willingness to dig in and learn is always important, but especially starting out.
  • Be a good team player. No room for egos or primadonnas on a high functioning team.

28 of 39

Mark Campanelli - Software Engineer

Code is read many more times than it is written. Projects have long term architecture that usually outlives any single developer. The simple solution is usually the easiest to maintain/extend. Good architecture usually makes testing easier. If you have to skip testing due to resource limitations, then don't also skimp on good architecture and ASAP (as simple as possible!).

Recommends watching: Simplicity Matters by Rich Hickey

29 of 39

Other tips

  • Programming is a craft that takes years to master.
  • strong fundamentals and a willingness to continue learning on the job
  • exposure to testing and basic processes
  • Passion and curiosity are key intrinsic values a computer scientist must have

30 of 39

What should a new hire know?

  • git
  • any js framework
  • some experience with DB
  • either C#, PHP, React, or Angular
  • Git Workflows, basic understanding of the SDLC and different ways to test your code, (Unit, Component Level, Integration, API, Functional, etc.)

31 of 39

Need an Internship?

32 of 39

In computer programming, unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use.[1]

33 of 39

Example - java

import org.junit.Test;

import static org.junit.Assert.*;

public class MyUnitTest {

@Test

public void testConcatenate() {

MyUnit myUnit = new MyUnit();

String result = myUnit.concatenate("one", "two");

assertEquals("onetwo", result);

}

}

34 of 39

Example - python - link

import unittest

class TestStringMethods(unittest.TestCase):

def test_upper(self):

self.assertEqual('foo'.upper(), 'FOO')

def test_isupper(self):

self.assertTrue('FOO'.isupper())

self.assertFalse('Foo'.isupper())

def test_split(self):

s = 'hello world'

self.assertEqual(s.split(), ['hello', 'world'])

# check that s.split fails when the separator is not a string

with self.assertRaises(TypeError):

s.split(2)

if __name__ == '__main__':

unittest.main()

35 of 39

Unit Test Tips

Keep them short and sweet

  • There should only be 1 assertion per test

They should be very fast to execute

Try writing your test FIRST

36 of 39

Additional Reading

37 of 39

Project 4 - FizzBuzzBazz + Unit Test

  • Return to FizzBuzz, recreate the PR as a new branch as opposed to originating from your fork
  • Modify program to return “Bazz” when a the number is a multiple of 7
  • Add unit tests that validate the function behaves as expected
  • Modify the README to indicate how to run the tests

38 of 39

Next Lecture

  • Unit Testing continued
  • Shell Scripting
  • Initial CI / CD

39 of 39

Questions?