Secure Systems Engineering, Spring 2024

Lab 2

Please read this description in its entirety before starting the lab!

Introduction

We will continue learning about Rust through another project. This project is more complicated than the previous one, and requires use of more advanced Rust concepts. These concepts will be useful for you as you implement the assignments and the course project. Note that there is an extra day for you to complete this project with your group – take your time, and try to make sure you understand everything before submitting.

Learning objectives

In this lab, you will:

Helpful resources

Lab setup

You’ll need to have Rust installed, just as in Lab 1.

Part 1: An I/O project

Go through Chapter 12, “Building a Command Line Program” in the Rust book. Follow each step, line-by-line, all the way until you have a complete minigrep program. Once again, I encourage you make sure to type each line into your editor, rather than copy-and-pasting. I will be available if you want to ask any questions.

Part 2: Reflection

After you’ve completed the project, add comments to the top of src/main.rs or src/lib.rs answering the following questions:

  1. Describe the process of reading and iterating over file contents in Rust. How is this different from other languages you might be familiar with?
  2. Explain the benefits of using external libraries for the tasks in this project. Would you have implemented this functionality yourself, or was it better to use an existing library?
  3. Explain the drawbacks of using external libraries for the tasks in this project. Try to think like a security engineer – what could go wrong?
  4. Discuss the challenges you faced while implementing the minigrep functionality. How did you overcome them?
  5. Reflect on the importance of code testing and documentation in a project like minigrep. How did you test your code? Why was it helpful?
  6. Describe any specific skills or tools you learned or used that you can apply to future projects.

What to turn in

Upload the following to Blackboard before the due date above:

Although this is a group assignment, each member of the group needs to submit their own copy to Blackboard. Make sure each group member’s name is in your Cargo.toml:

authors = ["Partner 1", "Partner 2"]