The Programming Project
A clear Fordel.
See Slides
- Introduction§1
- Who are You?§1.1
- What are we going to learn?§1.2
- What are we going to do?§1.3
- Wait, are the requirements changing?§1.4
- Why random groups?§1.5
- Why are we doing a Group Contract?§1.6
- We want structure!§1.7
- What are we not allowed to do?§1.8
- How are we graded?§1.9
- What if I really want to fail?§1.10
- What is the Contribution Score?§1.11
- What if we want to know more?§1.12
- What if we want help?§1.13
- What now?§1.14
- Who are You?§1.1
- The Technical Part§2
- Questions?§3
This a lecture note for first lecture, all details are in home as well.
Introduction §1
Who are You? §1.1
Me? My name is Christian Gram Kalhauge chrg@dtu.dk, I'm an associate professor, and I look forward to teaching you.
Christian, and
TA Christian (2 hours after 13, most days)
I have weird teaching philosophy, which you should check out (home (§1.2)).
You only learn from your mistakes.
What are we going to learn? §1.2
Please check out the section: home (§1.1)
Working in small groups
Prioritize requirements
Verify the code
Use version control
What are we going to do? §1.3
Please check out home (§1.4).
From 4th of June to 26th of June,
Work in random groups of four, to
Build a real product,
with changing requirements.
UTD needs a project and internship allocator.
You already have some code.
Wait, are the requirements changing? §1.4
Yes, at every meeting you will get more US to do.
You have to figure out what customer wants.
Out of meeting you can send emails, but expect some delay.
Why random groups? §1.5
See home (§1.6)!
Mimic Nature
Help you get a bigger network
Why are we doing a Group Contract? §1.6
See home (§2.1) for more.
A great change to set expectations.
It will be the
legal
document we will hold you to, if disputes happens.
How much do you want to work?
What happens is someone is not pulling their weight?
Or, if they pull too much?
In sickness and health.
What is unacceptable behavior?
If you work 120 hours, what grade would you expect?
How many hours on top would an better grade be worth to you?
How many sick days can you have?
Is using GenAI okay?
We want structure! §1.7
See the 2025 Course Plan structure.
What are we not allowed to do? §1.8
Please check out home (§1.3)
Plagiarise.
Break Copyright.
Copilot and ChatGPT is fine, but you own the code.
How are we graded? §1.9
Please check out home (§3)!
Value produced to the customer,
your report,
the amount and quality of the code written and tested,
your team work, and
your reflections on lessons learned.
What if I really want to fail? §1.10
It is very hard to fail this course, but there are some simple rules inspired by the LEGO model.
Blame is not for failure, it is for failing to help or ask for help. ― Jorgen Vig Knudstorp
So the answer is simple:
Do not write any code, or
Prevent your group members from writing code.
Writing tests is a great way to get unstuck and create value.
What is the Contribution Score? §1.11
Please check out: Contribution Score!
A clever way to calculate how much of the final version you contributed to.
Only looks at source code and the report.
You will get feedback before each meeting.
We have our code in a Git repository, on git-lab.
You cannot push directly to the main branch (use pull requests).
Only commits where you are the author counts.
If you are pair programming, switch between authors.
What if we want to know more? §1.12
Use the webpage :), but
let me know if something is missing.
What if we want help? §1.13
Use the TA slots (after 13, most days),
Contact the TA or Me on emails or teams,
I might arrange Q/A's during the course if needed.
Send anonymous feedback! home (§5)
What now? §1.14
Make sure to fill out your Group Contracts, home (§2.1).
Create a Gitlab (§4) account.
Come talk to me when both is done, and I'll create your repository.
The Technical Part §2
Now we are ready to get technical.
User Stories §2.1
We use User Story to represent the requirements.
As a student I want to have constant feedback so that I use the feedback to improve.
The Technologies §2.2
The code uses the following technologies.
HTTP §2.3
We are serving our sites using HTTP5.
A get request looks like this:
@GetMapping("/login")
public String getLogin() {
return "login"; // Render the login template
}And a post request looks like this:
@PostMapping("/login")
public String postLogin(
@RequestParam("email") String email,
@RequestParam("password") String password,
Model model,
HttpSession session) {
// ...
session.setAttribute("auth", auth);
return "redirect:/";
}Note that we retrive the email and password from the request, and then use the Http Session to save the authentication to an auth attribute. A session is the way a server can keep track of who is making the request.
Transactions and Unit-of-Work §2.4
When you use the code current code you might suddenly think, why did my database action not commit. It is because it has not been committed to source.
This is because we use Transactions, a transaction is the way to ensure that your data is consistent. It works by either accepting the full transaction or none of it.
The good thing about a key-chain is that you lose all your keys at once.
In our code we do it like this:
try (var uow = unitOfWork.begin()) {
auth = authenticator.authenticate(user, password);
uow.commit();
}Migrations §2.5
The only constant in software development is change. We can therefore not expect our database to remain the same. We therefore use a Migration system. It is very simple. We keep a numbered list of migrations in the main/resources/migration folder, and a version in our database. If the version of our database is smaller than the latest migration, we run all newer migration updating the server in the process.
In summary,
In file
X.sqldescribe how to go from databaseX-1toX.Never change a migration file, after it has been deployed.
Just create a new one.
Dependencies and Inversion §2.6
In the design of the webpage so far, we have used dependency Dependency Injection and inversion. The idea is to make the inner objects depend only on the behavior they need and then have the external packages depend on them!
Testing §2.7
It is important to test your code, we differentiate between two kinds of tests.
Unit Tests (Only test the behavior)
End-to-End Tests (Test everything)
Testing is often done in three stages:
Arrange (Setup the state)
Act (Do something)
Assert (Check the state has changed correctly)
@Test
@DisplayName("with no local is invalid")
void with_no_domain_is_invalid() {
var t = assertThrows(InvalidEmail.class,
() -> Email.of("my@"));
assertEquals("domain is empty", t.getMessage());
}Coverage §2.8
We test the number of lines or branches run by our tests.

100% is impossible, but
0% is unacceptable.
Questions? §3
Now is the time for questions.