230 likes | 375 Views
IERG4180 Tutorial 1. Jim. Content. About Microsoft Visual Studio About software bugs Debugging tools Assignment Overview. Microsoft Visual Studio (VS). Integrated Development E nvironment (IDE) for windows application Basically consists of source code editor Build automation tool
E N D
Content • About Microsoft Visual Studio • About software bugs • Debugging tools • Assignment Overview
Microsoft Visual Studio (VS) • Integrated Development Environment (IDE) for windows application • Basically consists of • source code editor • Build automation tool • debugger • Use VS to develop your work in assignment 1 • Can get it from Microsoft DreamSpark(for Students)
How to kill bugs? • Try to minimize the occurrence of bugs • Realize what you have to do first • Divide and conquer • Use meaningful variable name (if possible, follow some naming convention) • Indent appropriately • Make comments whenever you can • These will increase your code’s readability (at least more readable for yourself)
How to kill bugs? • In case bug happens.. • Check the error message, Google it • If no luck, then you need debugger to help you • Of course, printf / cout are still your good friends • Sometimes, Clean and Rebuild function might help
Debugging tools • Start Debugging (F5)
Breakpoint • Program pause for debugging purposes • Instruction breakpoint • interrupt right before a programmer-specified instruction is executed
Breakpoint • Conditional breakpoint • Similar to Instruction breakpoint, but it will only interrupt when a given condition is fulfilled
Tracepoint • a breakpoint that prints a message to the Output window
Autos/ Locals/ Watch • To track the value of the variables
Autos/ Locals/ Watch • To track the value of the variables
Step into • If the line contains a function call, Step Into executes only the call itself, then halts at the first line of code inside the function. Otherwise, Step Into executes the next statement.
Step Over • Similar to Step Into • Use Step Into if you want to look inside the function call. Use Step Over if you want to avoid stepping into functions.
Step Out • Step Out resumes execution of your code until the function returns, then breaks at the return point in the calling function.
Call Stack • list of names of methods called at run time from the beginning of a program until the execution of the current statement • help you understand the program flow
Overview of the assignments • Target: to implement network software product(s) (for sure) • For each assignment you have to deal with a software product • Each product is an “evolution” of the previous one • Details of each assignment will be further explained in later tutorials
Assignment 1 – NetProbe • One application with three modes • Sender • Receiver • HostInfo • It is a console application in Windows Receiver Sender
Assignment 2 – NetProbe version 2 • Two applications: server and client • extend the application in assignment 1 • One Server to deal with multiple Clients • Concurrent server model using multithreading • Your code should be able to compile and run in both Windows and Linux platform • Again, they are console applications, no GUI is required Client 1 Server Client 2 Client 3
Assignment 3 – a simple web server • Support HTTP protocol processing • Server: extends the server in assignment 2 • Client: HTTP Client (e.g. web browser) • Server side can serve HTTP GET requests from the client side • Implement two threading models • On-demand thread creation • Thread-pool models HTTP Client 1 Server HTTP Client 2 HTTP Client 3
Assignment 4 – a low latency web server • Try to make your web server to respond as soon as possible • Details will be confirmed soon