Evaluating a Solution - Computational Thinking PDF
Document Details
Uploaded by VibrantSard4401
King Khalid University
Tags
Summary
This document discusses evaluating solutions in computational thinking, examining correctness, efficiency, elegance, and usability. It covers various aspects of solution evaluation, including empirical testing, different complexity classes, and the importance of user-friendly design. In essence, it's a guide on evaluating different approaches to computing problems.
Full Transcript
Topic 8: Evaluating A Solution Reference: Computational Thinking a Beginner's Guide to Problem- solving and Programming – Chapter 6: pages 92-104 Solution Evaluation After you analyzed the problem, deconstructed it, and devised a solution design, which you implemented, tested, and debugg...
Topic 8: Evaluating A Solution Reference: Computational Thinking a Beginner's Guide to Problem- solving and Programming – Chapter 6: pages 92-104 Solution Evaluation After you analyzed the problem, deconstructed it, and devised a solution design, which you implemented, tested, and debugged. You now have a functioning product. So, you're done, right? Well, not exactly. The job isn't complete just because you have a working solution. To truly finish, you need to ensure the quality of your solution by thoroughly evaluating it. Solution Evaluation Evaluating a solution involves asking several basic questions, each addressing a specific aspect. Important questions about the solution include: ▪ Is it correct? Does it actually solve the problem you set out to solve? ▪ Is it efficient? Does it use resources reasonably? ▪ Is it elegant? Is it simple yet effective? ▪ Is it usable? Does it provide a satisfactory way for the target audience to use it? Is It Correct? To ensure your solution is correct, ask if it solves the original problem. If not, other quality measures are irrelevant. A solution must be correct, regardless of speed or complexity. Assume programs are incorrect until proven otherwise through testing and debugging. This approach is essential in fields like science and law to avoid false positives. Is It Correct? In computer science, proving a program's correctness often involves mathematical proof, especially for critical systems. However, the empirical testing approach is more common to prove a solution is correct. Empirical testing is done by carrying out a series of tests that aim to prove that the solution is correct. If the solution fails to pass one test, then the solution is incorrect. Is It Correct? During development, a problem is specified, and a test plan is prepared, with each requirement phrased as a test. Testing ensures that the solution meets the problem specifications. The more tests a solution passes, the stronger the evidence supporting its correctness. Is It Correct? Is It Correct? Is It Efficient? Each algorithm needs a certain amount of resources to operate. Algorithms designed to solve the same problem may vary in efficiency. Typically, their performance is measured by evaluating both time and space utilization. Time: the duration of an algorithm’s running time, from start to end. The duration can be measured as the number of steps taken during execution. Space: the amount of memory storage required by an algorithm to do its work. Is It Efficient? Evaluating an algorithm's efficiency depends on its time and space demands. If an analysis shows that the algorithm uses resources acceptably, it can be considered efficient. To measure an algorithm’s efficiency, complexity classes are used. Complexity class is a category that tells how an algorithm will behave in the worst case (the maximum amount of resources an algorithm might use). Is It Efficient? O: running time, N: number of inputs Is It Elegant? Creating elegant solutions can be more challenging than complex ones, as simplicity demands a deep understanding of the problem and pattern recognition. This process often involves innovative thinking. However, the effort is worthwhile, as the rewards of achieving an elegant solution can be significant. Is It Elegant? Elegance can play a role in evaluating a software solution. While two solutions may effectively solve a problem, they can be distinguished by how elegantly they do so. This concept of elegance applies not only to software but also to other functional disciplines like engineering, science, and mathematics. Elegance maximizes both effectiveness and simplicity at the same time. Is It Usable? Ultimately, your solution must cater to human users, providing a positive experience. While correctness, efficiency, and elegance are important, usability is key. Solutions should be easy to learn, simple to use, and forgiving of human errors. People seek user-friendly solutions that require minimal effort and accommodate their emotions and limitations. Usability measures how well something can be used by people to achieve their goals. Is It Usable? Usability can be formalized into measurable components: ▪ Learnability: how easy is it for users to accomplish basic tasks the first time they encounter the solution? ▪ Efficiency: once users have learned the solution, how quickly can they perform tasks? ▪ Memorability: when users return to the solution after a period of not using it, how easily can they re-establish proficiency? ▪ Errors: how many errors do users make, how severe are these errors and how easily can they recover from the errors? ▪ Satisfaction: how pleasant is it to use the design? Trade-offs No solution is perfect due to various factors like human errors or time constraints. Optimizing one aspect of a solution often compromises another. For example, improving efficiency might require more storage space, or reducing space usage might result in slower performance. This is known as a space-time trade-off. In various aspects, trade-offs are inevitable. It's impossible to optimize every quality aspect of a solution simultaneously. A crucial part of developing a solution is determining which quality aspects are most important and prioritizing their optimization accordingly.