Laboratory Exercises

Lab

Contents Submission deadline

Lab 1

(a) Exercise Sheet 1

End of Period 3

Lab 2

(a) Exercise sheet 2

JML syntax definition.

End of Period 3

Lab 3

(a) Exercise Sheet 3

(b) Instructions.pdf (c) bitshift.smv (d) carcontroller.smv

  NOTE 4 documents!

End of Period 3

General Lab Instructions:  You need to pass all 3 labs before you can pass the course. A lab has just two grades: (a) pass, (b) fail.

You can work on a lab alone, or with a partner. I don't recommend working as three, and more is not allowed.

If you fail a lab you must re-do it until it is passed. There is no specific time limit for this, but a good aim is to complete all the labs before the exam, alternatively before summer vacation.

On completing each lab, you should print out one hard-copy and bring it along to the exercise class the following week. Here we will go through model answers, and you should be able to see if you have passed each question, or if you made a mistake, what it was. You are encouraged to discuss your answers with me during an exercise class if there is something you did not understand.

At the end of the exercise class you should hand in to me one hard-copy of the lab (I do not for technical reasons accept electronic submissions). Make sure the names and e-mail addresses of all the lab partners are on the work. You do not need to hand in 2 solutions if you are 2 lab partners.

If you have not completed the lab (e.g. you are sick) or you cannot attend the exercise class the following week, then you can put a hard-copy of your lab work into my mail tray (Karl Meinke) on level 4 of the E building. You can do this at any time you wish, even after the course has finished.

I generally mark lab work in batches, so they may be some delay between submitting your work, and seeing a grade in rapp/ladok. If you doubt whether I have received your work you can mail me.

It is a good idea to keep a backup copy of all your lab work until you have completed the course.

Lab Rooms

You can find the lab rooms with this lab room map



Teacher Karl Meinke created page 19 November 2013

Karl Meinke tagged with labs. 19 November 2013

commented 3 February 2014

Hi!

Has the submission deadline for exercise 1 been set yet? Do we hand it in by email?

Teacher commented 3 February 2014

We will go through lab 1 at the next övning on Thursday. You should bring with you a hard copy of your lab 1 and hand it in at the end. 

Without this you will have no way to self assess your own work.

regards KM

commented 4 February 2014

Hi,

it would be great if the TBA part could be filled in. It was just pure luck that I spotted this message and a 2 days heads up is a little short in my opinion. 
I don't know if the deadline has been stated somewhere else but I think many just see the TBA-part and look no further believing there is lots of time left. Knowing the deadlines before hand also helps planning alot.
Thx in advance

/regards Mathias

Teacher commented 4 February 2014

Formally there is no deadline for these labs. However you cannot complete the course without submitting your work.

Also if you wish to self assess your own work (optional), you need to complete it before the övning class the following week. At each övning I go through some ideas for solutions.

I have tried to made this clear in lectures I think. regards

Karl

commented 4 February 2014

That's great news, that's it not a hard deadline.
It's fine to mention it in the lectures but if there is a course homepage with information, all information should be available there. If there is some information here and some other insider information at lectures, unnecessary mistakes can and will be made. 

/regards Mathias

Guillermo Rodriguez Cano edited 24 February 2014

Lab Contents Submission deadline Lab 1

Exercise sheet 1

End of Period 3 Lab 2

Exercise sheet 2

End of Period 3 Lab 3

Exercise sheet 3

(b) instructions.pdf (c) bitshift.smv (c) carcontroller.smv

(d) examples.zip  NOTE 5 documents!

End of Period 3 To pass the course you must complete and submit all lab assignmentsLab 4¶

Exercise sheet 4 (optional)¶

(b) exercise-skeleton.zip¶

End of Period 3 To pass the course you must complete and submit lab 1, 2 and 3 assignments.¶

Lab 4 is an optional lab (more information about grading soon to be given by Karl in class and posted here)
.

commented 14 March 2014

Hi,

I would like to know how we could submit any unsubmitted labs until the end of the period. Can we hand them in at CSC or do we have to meet you in person?Thank you in advance.

regards

Ioannis

Teacher commented 14 March 2014

Hi, you can put hard copies of your work in my mail tray on level 4 of the CSC building at any time. 

Thanks

KM

Teacher Karl Meinke changed the permissions 15 January 2015

Kan därmed läsas av alla och ändras av lärare.

Karl Meinke tagged with exercises. 15 January 2015

commented 18 February 2015

Maybe it's my bad, but I cannot find the "microwave oven specification" to which is referred to in lab 3 in the slides of lecture 6. Could you please clarify, where the information can be found? Thank you.

Teacher commented 18 February 2015

Yes, you are right. This part of the course has been edited. I will go over the material in the next lecture. I will also put up some slides on this site.

Thanks for drawing it to my attention.

commented 26 February 2015

So, the Microwave is removed from the lab?

Teacher commented 26 February 2015

Yes, we didn't get time for that part of the course this year. Please just skip over it in lab 3.

Henrik Karlsson removed his/her comment
Fadi Faris Costantien Al-Khoury removed his/her comment
Benjamin Burvall removed his/her comment
commented 15 February 2016

Regarding lab 2, has anyone managed to make JML work with Eclipse for Ubuntu? When compiling JML runtime checks, the following error message is presented:

/home/mikael/.eclipse/org.eclipse.platform_3.8_155965261/configuration/org.eclipse.osgi/bundles/210/1/.cp/java6/java/lang/Class.jml:31: error: The method java.lang.Class.Class() is a Java method (neither ghost nor model) but does not match any methods in the corresponding Java class.
    private Class();

commented 15 February 2016

If anyone else is having the same problem, the solution was to use JRE7 instead of 8, and to not use OpenJDK.

Karl Meinke edited 24 February 2016

Lab

Contents Submission deadline Lab 1

(a) Exercise Sheet 1

End of Period 3 Lab 2

(a) Exercise sheet 2

End of Period 3 Lab 3

(a)  Exercise sSheet 3

(b) Instructions.pdf (c) bitshift.smv (d) carcontroller.smv

(e) examples.zip  NOTE 5 documents!

End of Period 3 You can find the lab rooms with this lab room map

To pass the course you must complete and submit lab 1, 2 and 3 assignments.

commented 24 February 2016

Hey,

I did lab 3 before this update. As such the version was 3.0 instead this one (4.0).

So I would like to know if there are any changes besides the removal of old question two regarding "microwave oven specification"?

Thanks in advance.

/Shuang

Teacher commented 24 February 2016

No, I have just removed a "dead" exercise.

KM

Andreas Forsten removed his/her comment
Peter Caprioli removed his/her comment
commented 23 January 2017

Hi, is someone looking for a lab partner ?

I am a french double degree student and I prefer Java.

Karl Thorláksson removed his/her comment
commented 24 January 2017

Looking for a partner if anyone is interested. Jmobe@kth.se

Simon Ragnesand removed his/her comment
Johan Wikström removed his/her comment
commented 27 January 2017

Hi everyone! My name is Sparks, a master student of Control Track, Embedded Systems. I am looking for partners for Homework. If you are interested in, please reply or send me an email to wang3@kth.se . Thank you for your attention!

commented 27 January 2017

Hi to all out there! I am also looking for a partner. Language to use Java, please email to anapro@kth.se

commented 6 February 2017

Hi,

3 questions regarding lab 2.

1. Should the test suites have the same size for random testing and pairwise testing? For example if pairwise testing uses two sets of size 10 then random testing should have 100 test cases.

2. Should we use a cap for maximum value on the integers. If we use original max value of int then the probability that we get a git on an array of size 20, as suggested, is very small. If so, what should be our guideline when setting a max cap?

3. If a maxcap is used, should it be increased in the case when we increase N to 100 or 500?

Thank you for your time

Teacher commented 6 February 2017

1. One good way to tackle this question is to measure the average number of test cases required by each method to find the first fault (a mean-time-to-failure approach).

Otherwise you could normalise to the same size test suites, but the results could be less conclusive (e.g. both find or both don't find)

2. This has never come up before, but in any case there is always a cap on the size of the largest int.

3. Not sure I have really understood this question or question2?

commented 7 February 2017

You will need this pdf to solve the problem in lab2.

Design by Contract with JML

http://www.eecs.ucf.edu/~leavens/JML/jmldbc.pdf

commented 7 February 2017

About n-wise testing in lab 2, since a majority of errors are discovered with lower n, should we begin by doing the 0-wise test, then all 1-wise tests, and finally all 2-wise tests? And what should we use as typicals and how many? For instance, I suppose a few different boundary-value arrays (and some more "normal" cases), some where the default key is in them and some where it isn't, would suffice? And the analogous case for the default and typical key of course.

Teacher commented 7 February 2017

I doubt you will find any errors at all with 0-wise. You might like to try 1-wise separately if you wish, but the main emphasis is pairwise.

commented 7 February 2017

In that case, since the number of variables are two (the array and the key), wouldn't the only difference between random and pairwise be that in the pairwise case, we can predefine the cases strategically e.g. boundary cases? Still, to arrive at any larger volume of test cases, they would apart from that be the same since we'd probably like to rely on random generation to create all those test cases that might be necessary.

Teacher commented 7 February 2017

You cannot develop a good answer to lab 2 without considering an array as A.size() independent variables.

This example was carefully chosen to make scaling the problem dimension D very very easy!

commented 8 February 2017

I have a question regarding the random test framework. If I understand the lecture notes correctly, we simply generate a random input, and this randomly generated input will be one test case. 
However, are there any constraints on this randomly generated input (more specifically regarding the range) ? Is it really any input at random, or do we for example choose from a restricted subset ?

For example, if we allow each number in the array to truly be any integer, we will have a very small chance of obtaining a random "matching" key in one of our test cases. Wouldn't that be a problem ?

Teacher commented 8 February 2017

Hi all,

there are getting just too many questions on this page for me to answer them all individually.

I suggest you bring your questions to the lab tomorrow (Thursday) where it will be easier and quicker for me to answer them.

Thanks

Karl Meinke

commented 9 February 2017

Approximately when are we going to get the results for lab 1 (and 2)? And if one happens to fail a lab, will there be a chance to do some kind of make-up?

Teacher commented 9 February 2017

You will find lab grades in Rapp when they are ready.

If you fail a lab you must redo and resubmit. The comments will tell you what to do.

Karl Meinke

commented 13 February 2017

Hi,

About Lab 2, how are we suppose to submit the implemented program from question 3? Should we print out the code and hand it with the other questions?

/Alan 

Teacher commented 13 February 2017

Please read the lab notes carefully and just submit the tables of your comparisons of n-wise and random.

commented 28 February 2017

Hi,

I was wondering about lab 3, do you want a collection of the the correct outputs as a report, or are we suppose to write down something else?

Thanks in advance, /Addi 

Teacher commented 28 February 2017

For lab 3 you need to tabulate your test cases. Please read the lab instructions carefully.

KM

commented 6 March 2017

In lab3... it says that there are only 6 edges in the carcontroller state graph but the way I see it there are 7... For each of the three states, there are 4 input combinations (a & b, a & !b, !a & b, !a & !b) and so when drawing the graph and the transitions, I end up with 7 edges (including 2 self-loops in states STOP and FAST)... am I "out biking" as we say in Swedish or am I right? :)

commented 7 March 2017

What date is "End of Period 3" going to be? 

commented 13 March 2017

I agree with Elias. I get the transitions looking something like this:
transitions

Teacher commented 13 March 2017

I think already in the course notes it points out that the model there is incomplete, just the most important transitions are present that show the idea.

KM

Karl Meinke edited 16 January 2018

Lab

Contents Submission deadline Lab 1

(a) Exercise Sheet 1

End of Period 3 Lab 2

(a) Exercise sheet 2

JML syntax definition.

End of Period 3 Lab 3

(a) Exercise Sheet 3

(b) Instructions.pdf (c) bitshift.smv (d) carcontroller.smv

(e) examples.zip  NOTE 5 documents!

End of Period 3 You can find the lab rooms with this lab room map¶ To pass the course you must complete and submit lab 1, 2 and 3 assignments.General Lab Instructions:  You need to pass all 3 labs before you can pass the course. A lab has just two grades: (a) pass, (b) fail.¶

You can work on a lab alone, or with a partner. I don't recommend working as three, and more is not allowed.¶

If you fail a lab you must re-do it until it is passed. There is no specific time limit for this, but a good aim is to complete all the labs before the exam, alternatively before summer vacation.¶

On completing each lab, you should print out one hard-copy and bring it along to the exercise class the following week. Here we will go through model answers, and you should be able to see if you have passed each question, or if you made a mistake, what it was. You are encouraged to discuss your answers with me during an exercise class if there is something you did not understand.¶

At the end of the exercise class you should hand in to me one hard-copy of the lab (I do not for technical reasons accept electronic submissions). Make sure the names and e-mail addresses of all the lab partners are on the work. You do not need to hand in 2 solutions if you are 2 lab partners.¶

If you have not completed the lab (e.g. you are sick) or you cannot attend the exercise class the following week, then you can put a hard-copy of your lab work into my mail tray (Karl Meinke) on level 4 of the E building. You can do this at any time you wish, even after the course has finished.¶

I generally mark lab work in batches, so they may be some delay between submitting your work, and seeing a grade in rapp/ladok. If you doubt whether I have received your work you can mail me.¶

It is a good idea to keep a backup copy of all your lab work until you have completed the course.¶



Lab Rooms¶

You can find the lab rooms with this lab room map¶

Feedback News