diff --git a/exercises/part_1.md b/exercises/part_1.md index 1cf394f..b0a30b0 100644 --- a/exercises/part_1.md +++ b/exercises/part_1.md @@ -26,4 +26,4 @@ 5. Push the new branch to your (forked) repository on GitHub. -6. Create and issue a pull request against the workshop repository. +6. Create a pull request against the workshop repository. diff --git a/exercises/solutions/figures/add_activity_cards_01.png b/exercises/solutions/figures/add_activity_cards_01.png new file mode 100644 index 0000000..a417d9e Binary files /dev/null and b/exercises/solutions/figures/add_activity_cards_01.png differ diff --git a/exercises/solutions/figures/add_activity_cards_02.png b/exercises/solutions/figures/add_activity_cards_02.png new file mode 100644 index 0000000..dd786c8 Binary files /dev/null and b/exercises/solutions/figures/add_activity_cards_02.png differ diff --git a/exercises/solutions/figures/add_project.png b/exercises/solutions/figures/add_project.png new file mode 100644 index 0000000..c09d4f6 Binary files /dev/null and b/exercises/solutions/figures/add_project.png differ diff --git a/exercises/solutions/figures/create_project_01.png b/exercises/solutions/figures/create_project_01.png new file mode 100644 index 0000000..8c84ca8 Binary files /dev/null and b/exercises/solutions/figures/create_project_01.png differ diff --git a/exercises/solutions/figures/create_project_02.png b/exercises/solutions/figures/create_project_02.png new file mode 100644 index 0000000..a8d2095 Binary files /dev/null and b/exercises/solutions/figures/create_project_02.png differ diff --git a/exercises/solutions/figures/create_project_03.png b/exercises/solutions/figures/create_project_03.png new file mode 100644 index 0000000..c799947 Binary files /dev/null and b/exercises/solutions/figures/create_project_03.png differ diff --git a/exercises/solutions/figures/create_project_04.png b/exercises/solutions/figures/create_project_04.png new file mode 100644 index 0000000..363a132 Binary files /dev/null and b/exercises/solutions/figures/create_project_04.png differ diff --git a/exercises/solutions/figures/create_pull_request_01.png b/exercises/solutions/figures/create_pull_request_01.png new file mode 100644 index 0000000..96b190b Binary files /dev/null and b/exercises/solutions/figures/create_pull_request_01.png differ diff --git a/exercises/solutions/figures/create_pull_request_02.png b/exercises/solutions/figures/create_pull_request_02.png new file mode 100644 index 0000000..e1af628 Binary files /dev/null and b/exercises/solutions/figures/create_pull_request_02.png differ diff --git a/exercises/solutions/figures/fork.png b/exercises/solutions/figures/fork.png new file mode 100644 index 0000000..ee3882b Binary files /dev/null and b/exercises/solutions/figures/fork.png differ diff --git a/exercises/solutions/figures/gitk.png b/exercises/solutions/figures/gitk.png new file mode 100644 index 0000000..4b9b31b Binary files /dev/null and b/exercises/solutions/figures/gitk.png differ diff --git a/exercises/solutions/figures/review_merge_pull_request_01.png b/exercises/solutions/figures/review_merge_pull_request_01.png new file mode 100644 index 0000000..571d1b8 Binary files /dev/null and b/exercises/solutions/figures/review_merge_pull_request_01.png differ diff --git a/exercises/solutions/figures/review_merge_pull_request_02.png b/exercises/solutions/figures/review_merge_pull_request_02.png new file mode 100644 index 0000000..ddf09ac Binary files /dev/null and b/exercises/solutions/figures/review_merge_pull_request_02.png differ diff --git a/exercises/solutions/figures/review_merge_pull_request_03.png b/exercises/solutions/figures/review_merge_pull_request_03.png new file mode 100644 index 0000000..99bce13 Binary files /dev/null and b/exercises/solutions/figures/review_merge_pull_request_03.png differ diff --git a/exercises/solutions/part_1_solutions.md b/exercises/solutions/part_1_solutions.md new file mode 100644 index 0000000..ce52532 --- /dev/null +++ b/exercises/solutions/part_1_solutions.md @@ -0,0 +1,68 @@ +# GitHub Agile Workflow + +***In these exercises, we'll practice a basic GitHub workflow, useful when you want to contribute to a project.*** + +## Exercise I: Contribute to a project. + +1. On GitHub, fork the workshop repository into your own GitHub account. + + **Solution:** + + + +2. On your local machine, create a clone of the forked (your) workshop GitHub repository. + + **Solution:** + + git clone git@github.com:/SoftwareDevInScience + +3. Create a new local branch. + + **Solution:** + + git checkout -b + + or + + git branch + git checkout + + to show all branches: + + git branch -a + +4. On the new branch, make any changes you want to the *printNumbers* example project and commit them. + + **Solution:** + + show repository status: + + git status + + add changes: + + git add * + + commit changes: + + git commit -m"" + + show repository status: + + git status + +5. Push the new branch to your (forked) repository on GitHub. + + **Solution:** + + git push origin + +6. Create and issue a pull request against the workshop repository. + + **Solution:** + + + + ---- + + diff --git a/exercises/solutions/part_2_solutions.md b/exercises/solutions/part_2_solutions.md new file mode 100644 index 0000000..1782150 --- /dev/null +++ b/exercises/solutions/part_2_solutions.md @@ -0,0 +1,168 @@ +# Manage GitHub Projects + +***In these exercises, we will use GitHub functionality to organize our software development work into projects and a Kanban-like workflow. We will extend our small Python example source code with new functionality, using the test-driven software development approach.*** + +## Exercise II: Create a GitHub project using a Kanban-like dashbord. + +1. Under GitHub profile, create a new project and select the *Board* template. + + **Solution:** + + + + ---- + + + + ---- + + + + ---- + + + +2. Add at least two activity cards to the ToDo list, one for implementating a new function and another for a corresponding unit test. The unit test should describe test cases that correspond to the function you are plan to implement. + + **Solution:** + + + + Hint :+1: You must type a title and then hit enter to create a draft-card. + + ---- + + + + +3. Add the project to your forked repository. + + **Solution:** + + + +4. (optional) Explore other possibilities you have to set up a GitHub project. + + **Solution:** + + For example, create another project and chose a different template option. + + +## Exercise III: Test-driven development. Work with a partner and form a two-developers team. + +1. Update your _'main branch'_ to be in sync with the GitHub workshop repository. + + **Solution:** + + add the workshop repository to Git using the alias _'upstream'_ + + git remote add upstream https://github.com/gtrensch/SoftwareDevInScience + + show remote repositories + + git remote -v + + switch to main branch + + git checkout main + + fetch from remote repository with alias _'upstream'_ and updated the local reopistory + + git pull upstream main + +2. Developer A: Create a new feature-branch for the project that you have set up in Exercise II. + + **Solution:** + + git checkout -b + +2. Developer A: Implement the unit test cases that you have defined in Exercise II. + + **Solution:** + + Add, for example, a new unit test for a square function, e.g., _test_square.py_. + +3. Developer A: Add, commit and push your changes. + + **Solution:** + + git add * + + git commit -m"" + + git push origin + +4. Developer B: Pull the feature-branch from Developer A and make it your current branch. + + **Solution:** + + add the remote repository of developer A: + + git remote add https://github.com//SoftwareDevInScience + + git fetch + + switch to the feature-branch created by developer A: + + git checkout + +5. Developer B: Based on the current branch, create a new working-branch to implement the new functionality. + + **Solution:** + + git checkout -b + +6. Developer B: Implement the functionality that your test cases define. Use the unit tests to verify the correctness of your implementation. + + **Solution:** + + Add, for example, a new functionn _square.py_ and run the test suite. + + Python runTestSuite.py + +7. Developer B: Add, commit and push your changes. + + **Solution:** + + git add * + + git commit -m"" + + git push origin + +8. Developer B: Issue a pull request against the feature-branch. + + **Solution:** (see also solution Exercise I / 6.) + + pull request + <-------------- + +9. Developer A: Code-review the pull request and merge it. + + **Solution:** + + + + ---- + + + + ---- + + + + +10. Developer A: Create a pull request from the feature-branch against the workshop repository. + + **Solution:** (see also solution Exercise I / 6.) + + pull request + <-------------- + +11. (optional) Use the graphical repository browser *gitk* to explore the history of your repository. + + **Solution:** + + gitk + + diff --git a/printNumbers/printNumbers.py b/printNumbers/printNumbers.py index 9f9ef0e..6369ae1 100755 --- a/printNumbers/printNumbers.py +++ b/printNumbers/printNumbers.py @@ -40,6 +40,7 @@ from functions.fibonacci import * from functions.factorial import * +print('Starting the code...') # # FUNCTION TABLE # diff --git a/slides/Agenda.pdf b/slides/Agenda.pdf new file mode 100644 index 0000000..21c3e86 Binary files /dev/null and b/slides/Agenda.pdf differ diff --git a/slides/Documentation.pdf b/slides/Documentation.pdf new file mode 100644 index 0000000..320f442 Binary files /dev/null and b/slides/Documentation.pdf differ diff --git a/slides/FurtherReadings.pdf b/slides/FurtherReadings.pdf new file mode 100644 index 0000000..aef7e18 Binary files /dev/null and b/slides/FurtherReadings.pdf differ diff --git a/slides/LicensingAndCopyright.pdf b/slides/LicensingAndCopyright.pdf new file mode 100644 index 0000000..3e8e49a Binary files /dev/null and b/slides/LicensingAndCopyright.pdf differ diff --git a/slides/SourceCodeQuality.pdf b/slides/SourceCodeQuality.pdf new file mode 100644 index 0000000..ea2eba5 Binary files /dev/null and b/slides/SourceCodeQuality.pdf differ diff --git a/slides/Testing.pdf b/slides/Testing.pdf new file mode 100644 index 0000000..e4a281a Binary files /dev/null and b/slides/Testing.pdf differ diff --git a/slides/VersionControl.pdf b/slides/VersionControl.pdf new file mode 100644 index 0000000..dfd7115 Binary files /dev/null and b/slides/VersionControl.pdf differ