# 31.5 Exerises

## Factual

1. For each of the following, state whether they prevent, exacerbate, or have no effect on information leakage.
   * using unnecessary print statements to show the state of the program while it's running
   * employing temporal decomposition when architecting your code
   * creating deep modules
   * using helper methods and classes
2. In Woolley's study, which factors correlated with the quality of a team's output?

<details>

<summary>Problem 1</summary>

The key to remember is that information leakage is *not* related to the state of the program. Instead, it's when multiple pieces of code reflect a single design decision/module, introducing unnecessary complexity and dependencies.

* **Using unnecessary print statements to show the state of the program while it's running:** no effect on information leakage.&#x20;
* **Employing temporal decomposition when architecting your code**: exacerbates information leakage.
* **Creating deep modules**: prevents information leakage.
* **Using helper methods and classes**: prevents information leakage.

</details>

<details>

<summary>Problem 2</summary>

The two most important factors were *turn-taking* during conversations and the average ability of the group members to *recognize emotional state* from a person's eyes.

</details>

## Metacognitive

1. Give some examples of unnecessary obscurity that contributes to complexity.
2. Give some examples of unnnecessary dependencies that contribute to complexity.

<details>

<summary>Problem 1</summary>

There are many kinds of obscurity that can contribute to complexity. These include putting too much code into one function or module, having a large amount of variables that need to be maniuplated, and not breaking up your code or having helper functions.

</details>

<details>

<summary>Problem 2</summary>

One example is copy-pasting code across different modules. This means that to change this block of code, you have to change every location that this code appears in.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cs61b-2.gitbook.io/cs61b-textbook/31.-software-engineering-ii/31.5-exerises.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
