14
UNIVERZITET U NOVOM SADU TEHNIČKI FAKULTET „MIHAJLO PUPIN“ ZRENJANIN NASTAVNI PREDMET: Programski prevodioci PREDMETNI NASTAVNIK: Doc. dr Ljubica Kazi ŠK. 2020/21 12. ČAS – 14.5.2021. - VEŽBE TEME: ILUSTRACIJA Pregled alata za merenje performansi Instrumentacije i profiling u VS.NET Podešavanje C# kompajlera i preprocesorske direktive ZADACI: Breakpoint Merenje vremena izvršavanja C# naredbi manuelnom instrumentacijom ILUSTRACIJA PREGLED ALATA ZA MERENJE PERFORMANSI IZVOR: https://techbeacon.com/app-dev-testing/60-great-resources-performance-engineering-teams The web performance optimization (WPO) stats compiled here can help. Case studies and experiments demonstrate WPO's impact on user experience and business metrics. If you're trying to convince your organization that performance testing is important to your software development efforts, this is a great place to start. Keep in mind that WPO is just one small piece of performance engineering. One-user and front-end performance As companies begin to shift left in their performance activities , one-user performance is one area that is often overlooked. James Pulley , an independent consultant working with PerfBytes, said in a recent TestGuild performance podcast that most engineers focus on how their applications perform for many concurrent users. It's equally important, though, to know whether an app also scales for one. Client-side, one-user performance is important because testing has moved to the front end, with a focus on user experience (UX) performance . Modern applications spend more time in the browser than on the server side, with many apps using JavaScript frameworks such as React and Angular front ends. These feature-rich front ends add a new layer that needs to be measured. So the measurement of the rendering time of an application that is under test on a client's local machine becomes critical. This also leads to applications becoming more complex, with heavier front ends that use up more resources. Because of this, there's a need to also include performance testing from the user's perspective. Guy Arieli , CEO of Experitest, believes that mobile UX performance is even more significant than the apps' performance. When you work with your browser on your desktop, you are connected via Wi-Fi. And the bandwidth that you're using will be relatively high compared to anything you will find in 3G or even 4G, especially with changing network conditions and where the reception is not very good. A pillar of performance engineering is that performance needs to be baked into your software from the beginning, with developers creating performant code in your product from the start. Here are some resources to help you test all of the above. Tools to capture front-end performance Webpagetest is the standard for measuring performance from users' perspectives and for capturing visual metrics. It is a free service that provides a website speed test; it allows you to run your test from multiple locations using real browsers at real consumer connection speeds. You can also create your own instance of a web page test and run it behind the firewall to verify your intranet pages or pages that are under development. Webpagetest give you test location options that include testing from an Android or iOS device as well. Detox Instruments is a performance analysis and testing framework designed to help developers profile their mobile apps to better understand and optimize their behavior and performance. It can help your developers find issues early in the development cycle for mobile apps. Cristian Daniel Marquez Barrios , a front-end developer with over 10 years of experience, suggests that your front-end developers should be using, at a minimum, Google Lighthouse metrics . These are available in Google Chrome tools. When you open DevTools in Chrome and navigate to the Audits tab, you can find the

ILUSTRACIJA - tfzr.uns.ac.rs

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ILUSTRACIJA - tfzr.uns.ac.rs

UNIVERZITET U NOVOM SADU TEHNIČKI FAKULTET „MIHAJLO PUPIN“ ZRENJANIN NASTAVNI PREDMET: Programski prevodioci PREDMETNI NASTAVNIK: Doc. dr Ljubica Kazi ŠK. 2020/21 12. ČAS – 14.5.2021. - VEŽBE TEME: ILUSTRACIJA

Pregled alata za merenje performansi Instrumentacije i profiling u VS.NET Podešavanje C# kompajlera i preprocesorske direktive

ZADACI: Breakpoint Merenje vremena izvršavanja C# naredbi manuelnom instrumentacijom

ILUSTRACIJA PREGLED ALATA ZA MERENJE PERFORMANSI IZVOR: https://techbeacon.com/app-dev-testing/60-great-resources-performance-engineering-teams The web performance optimization (WPO) stats compiled here can help. Case studies and experiments demonstrate WPO's impact on user experience and business metrics. If you're trying to convince your organization that performance testing is important to your software development efforts, this is a great place to start. Keep in mind that WPO is just one small piece of performance engineering. One-user and front-end performance As companies begin to shift left in their performance activities, one-user performance is one area that is often overlooked. James Pulley, an independent consultant working with PerfBytes, said in a recent TestGuild performance podcast that most engineers focus on how their applications perform for many concurrent users. It's equally important, though, to know whether an app also scales for one. Client-side, one-user performance is important because testing has moved to the front end, with a focus on user experience (UX) performance. Modern applications spend more time in the browser than on the server side, with many apps using JavaScript frameworks such as React and Angular front ends. These feature-rich front ends add a new layer that needs to be measured. So the measurement of the rendering time of an application that is under test on a client's local machine becomes critical. This also leads to applications becoming more complex, with heavier front ends that use up more resources. Because of this, there's a need to also include performance testing from the user's perspective. Guy Arieli, CEO of Experitest, believes that mobile UX performance is even more significant than the apps' performance. When you work with your browser on your desktop, you are connected via Wi-Fi. And the bandwidth that you're using will be relatively high compared to anything you will find in 3G or even 4G, especially with changing network conditions and where the reception is not very good. A pillar of performance engineering is that performance needs to be baked into your software from the beginning, with developers creating performant code in your product from the start. Here are some resources to help you test all of the above. Tools to capture front-end performance

Webpagetest is the standard for measuring performance from users' perspectives and for capturing visual metrics. It is a free service that provides a website speed test; it allows you to run your test from multiple locations using real browsers at real consumer connection speeds. You can also create your own instance of a web page test and run it behind the firewall to verify your intranet pages or pages that are under development. Webpagetest give you test location options that include testing from an Android or iOS device as well.

Detox Instruments is a performance analysis and testing framework designed to help developers profile their mobile apps to better understand and optimize their behavior and performance. It can help your developers find issues early in the development cycle for mobile apps.

Cristian Daniel Marquez Barrios, a front-end developer with over 10 years of experience, suggests that your front-end developers should be using, at a minimum, Google Lighthouse metrics. These are available in Google Chrome tools. When you open DevTools in Chrome and navigate to the Audits tab, you can find the

Page 2: ILUSTRACIJA - tfzr.uns.ac.rs

Lighthouse audit. This will measure the performance of your site, simulating mobile on a desktop version of a browser, so it's a really good tool to start with.

Sitespeed.io is a set of open-source tools that make it easy to measure the performance of your website. It includes not only the software that can run performance tests, but also Grafana (see below).

Grafana collects and presents results from several test rounds, which means you can monitor the performance of your site. The tool also allows you to take a lot of additional actions, such as verifying the performance of all the pages of your site, or selected pages. You can also simulate different network connections, and much more.

Other tools Sitespeed.io gives you include: Coach, which can help make your web page faster. Coach acts like a modern version of YSlow, and gives you

advice for how your page could be faster. Browsertime; this lets you automate running JavaScript in your browser to collect performance-timing metrics

of your website. Compare, which matches two HAR files and finds regressions. PageXray; this converts a HAR file to a JSON format that is easier to read. Throttle, which simulates slow network connections on Linux and macOS X and helps you see how the

application performs when bandwidth is limited. Chrome-HAR, which creates Chrome HAR files based on events from the Chrome Debugging Protocol.

Other client-side performance resources If your application is very heavy on JavaScript client-side functionality, you're going to want to measure that as well. Here are some other tools to analyze web pages, monitor performance, and find front-end code quality issues.

YSlow analyzes web pages and determines why they're slow, based on Yahoo's rules for high-performance websites.

YellowLab Tools contain an online test to help speed up heavy web pages. Varvy tests your site to determine whether it follows the Google guidelines for speed. Benchmark.js is a benchmarking library that supports high-resolution timers and returns statistically significant

results. PerfMap allows you to create a front-end performance heat map of resources loaded in the browser using the

Resource Timing API. Phantomas is a PhantomJS-based web performance metrics collection and monitoring tool. Webperf Heat Maps generates performance heat maps of web pages. Zombie.js is a lightweight framework for testing client-side JavaScript code in a simulated environment. No

browser is required. Performance testing example sites If you're just getting started or don't have an app to run performance tests against, it's useful to have an example app to test against to help you as you learn. Here are a few web pages designed solely for this purpose.

If you're an old-time Mercury automation engineer, you'll probably remember the sample site called Mercury Tours that shipped with WinRunner, QTP, and UFT. You can also use it as an example performance testing site.

Another old-time favorite website for performance testing is a full web application called JpetStore; it's built on top of MyBatis 3, Spring 5, and Stripes.

Blazemeter also has a popular test site; it's called BlazeDemo. Resources for performance testing newbies In addition to Effective Performance Engineering, the book already mentioned above, here are a few other resources:

The Every Computer Performance Book, by Bob Wescott. This is a short, witty book on how to solve and avoid application and/or computer performance problems.

PerfBytes is a must-listen podcast focusing on all things performance testing. Señor Performo’s blog is a fun site for beginners, explaining basic concepts with silly examples. Performance Testing Guidance for Web Applications is a free e-guide that shows you an end-to-end approach

for implementing performance testing. The Test Guild Performance and Site Reliability Engineering podcast is a great show for beginners in the

performance space. Designing for Performance, by Lara Callender Hogan; this book helps you approach projects with page speed

in mind, showing you how to test and benchmark the most critical design choices. Practical Scalability Analysis with the Universal Scalability Law, by Baron Schwartz; this helps you understand

the connections between scalability and other disciplines, such as performance optimization and the study of queuing.

[ Related story: 6 test automation tools developers love ]

Page 3: ILUSTRACIJA - tfzr.uns.ac.rs

Performance testing tools Once you have a website to test against and a basic understanding of performance testing, you can take a look at some open-source performance testing tool options:

JMeter is the most popular open-source tool in the load-testing space. Apache’s JMeter describes itself as a Java application that was designed specifically for load testing with the ability to measure performance.

Taurus has the user-friendly option of allowing you to write your tests in YAML. You can describe a full-blown script in about 10 lines of text, which gives your teams the ability to describe their tests in a YAML or JSON file.

Gatling is a stress tool built on Scala, Akka, and Netty. It allows you to test and measure your application’s end-to-end performance.

Locust is a simple-to-use, distributed, Python-based load-testing tool. k6 is a developer-centric, open-source load-testing tool for testing the performance of your back-end

infrastructure. Grinder is a load-testing Java framework that makes it easy to run a distributed test that leverages a host of

load injector machines. Fortio is a load testing library, command line tool, advanced echo server, and web UI in go (golang). It allows

you to specify a set query-per-second load and record latency histograms and other useful stats. Performance monitoring tools Monitoring performance is a key element to ensure that your application will perform perfectly in the wild. However, if you look at Gartner's Magic Quadrant for Application Performance Monitoring report, all the tools listed are paid tools. For the folks who don’t have a budget for paid tools, here are some free APM solutions you should check out.

Pinpoint is currently the most popular application performance management tool on Github. JavaMelody monitors JavaEE apps. Skywalking monitors microservices and container-based architectures. Stagemonitor monitors Java server applications. Dynatrace's Appmon offers a personal license you can use free for life in your local environment. The Prefix web request profiler can help you validate the behavior of your code and find hidden exceptions in

your code. It can also find slow SQL query issues. Google performance resources Google has a bunch of great tools to help you understand how to improve the performance of your web and other applications. Here are a few:

Google Developer Tools can help you get started analyzing run time performance issues. As previously mentioned, Google Lighthouse is an open-source, automated tool that audits performance,

accessibility, progressive web apps, and more. Web Fundamentals contains explanations, examples, and recommendations that focus on low-effort, high-

return performance wins. Google PageSpeed reports on the performance of a page on both mobile and desktop devices, providing

suggestions about how that page can be improved. Chrome User Experience Report is a treasure trove of metrics, powered by real-user measurement data.

Knowing this data can help you create more realistic tests for how your application will be used in production. Test infrastructure performance resources Paul Bruce, DevOps advocate and automation and performance engineer at Neotys, says that in his experience, the traditional folks managing performance are missing the huge dangers and opportunities of the Kubernetes world. Here are some Kubernetes performance testing resources:

Kubernetes perf-tests is a repository dedicated to storing various Kubernetes-related performance test-related tools. If you want to add your own load test, benchmark, framework, or other tool, contact one of the owners.

JMeter Cluster supports Kubernetes and OpenShift. Measuring of API performance describes a test plan for quantifying the API performance of container cluster

systems. Load Testing Kubernetes is a video from the Cloud Native Computing Foundation to help you optimize your

cluster resource allocation in production. Let's not forget Docker. Here are some Docker images that have performance testing tools baked into them from the beginning:

JMeter Docker is a lightweight Docker image for Apache JMeter. Jenkins Performance Plugin allows you to capture reports from popular testing tools. Jenkins will generate

graphics with a trend report of performance and robustness. It allows you to set the final build status as good, unstable, or failed, based on the reported error percentage.

Page 4: ILUSTRACIJA - tfzr.uns.ac.rs

Keptn is a control-plane for DevOps automation of cloud-native applications. Keptn uses a declarative approach to build automation for delivery and operations, which can be scaled to a large number of services.

Site reliability Because I'm old school, I still call many software development activities "performance testing," but I’ve begun to see a trend that has this term falling by the wayside. Mark Tomlinson, the "performance sherpa," has an interesting theory. He says that if you listen to developers speak, they tend to use the term "webperf" rather than "performance testing." So it's very clear that developers and engineers are doing performance work. Web designers are doing performance work. Infrastructure teams are doing performance work. And none of them self-identify as "testers" in their organizations. So, if you’re like me and still call it performance testing, don’t ignore resources that also exist for site reliability engineers or infrastructure teams. Here are some examples:

The Site Reliability Engineering Book: In this free e-book, members of Google's SRE team explain how their engagement with the entire software lifecycle has helped Google build, deploy, monitor, and maintain some of the largest software systems in the world.

Chaos Engineering: In this report, members of the Netflix team that developed chaos engineering explain how to apply these principles to your own system. By introducing controlled experiments, you'll learn how behavior from component interactions can cause your system to drift into an unsafe, chaotic state.

Chaos Monkey randomly terminates virtual machine instances and containers that run inside your production environment. Exposing engineers to failures more frequently gives them incentives to build resilient services.

If you’ve tried using Chaos Monkey in the past, you may have found it difficult to use and understand. There’s another product built on top of it called Gremlin that makes it easier to get started.

Gremlin Free provides the ability to run both Shutdown and CPU attacks on your hosts or containers, controlled by a simple user interface at no cost.

INSTRUMENTACIJA I PROFILING U VS.NET

IZVOR: https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/tracing-and-instrumenting-applications

Tracing is a way for you to monitor the execution of your application while it is running. You can add

tracing and debugging instrumentation to your .NET Framework application when you develop it, and

you can use that instrumentation both while you are developing the application and after you have

deployed it. You can use the System.Diagnostics.Trace, System.Diagnostics.Debug,

and System.Diagnostics.TraceSource classes to record information about errors and application

execution in logs, text files, or other devices for later analysis.

The term instrumentation refers to an ability to monitor or measure the level of a product's

performance and to diagnose errors. In programming, this means the ability of an application to

incorporate:

Code tracing - Receiving informative messages about the execution of an application at run time.

Debugging - Tracking down and fixing programming errors in an application under

development. For more information, see Debugging.

Performance counters - Components that allow you to track the performance of your

application. For more information, see Performance Counters.

Event logs - Components that allow you to receive and track major events in the execution of

your application. For more information, see the EventLog class.

Instrumenting your application by placing trace statements at strategic locations in your code is

especially useful for distributed applications. By using trace statements you can instrument an

application not only to display information when things go wrong, but also to monitor how well the

application is performing.

Page 5: ILUSTRACIJA - tfzr.uns.ac.rs

Detalji instrumentacije i profilinga u VSNET

https://devblogs.microsoft.com/visualstudio/new-dynamic-instrumentation-profiling/

Pokretanje opcije za profiling u VS.NET

PREPROCESORSKE DIREKTIVE

IZVORl http://www.tutorialspoint.com/csharp/csharp_preprocessor_directives.htm Copyright © tutorialspoint.com

C# - PREPROCESSOR DIIRREECCTTIIVVEESS The preprocessor directives give instruction to the compiler to preprocess the information before actual compilation starts. All preprocessor directives begin with #, and only white-space characters may appear before a preprocessor directive on a line. Preprocessor directives are not statements, so they do not end with a semicolon ; . C# compiler does not have a separate preprocessor; however, the directives are processed as if there was one. In C# the preprocessor directives are used to help in conditional compilation. Unlike C and C++ directives, they are not used to create macros. A preprocessor directive must be the only instruction on a line.

Preprocessor Directives in C# The following table lists the preprocessor directives available in C#: Preprocessor Directive Description. #define It defines a sequence of characters, called symbol. #undef It allows you to undefine a symbol. #if It allows testing a symbol or symbols to see if they evaluate to true. #else It allows to create a compound conditional directive, along with #if. #elif It allows creating a compound conditional directive. #endif Specifies the end of a conditional directive. #line It lets you modify the compiler's line number and optionally the file name output for errors and warnings.

Page 6: ILUSTRACIJA - tfzr.uns.ac.rs

#error It allows generating an error from a specific location in your code. #warning It allows generating a level one warning from a specific location in your code. #region It lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Code Editor. #endregion It marks the end of a #region block.

The #define Preprocessor The #define preprocessor directive creates symbolic constants. #define lets you define a symbol such that, by using the symbol as the expression passed to the #if directive, the expression evaluates to true. Its syntax is as follows: #define sym bol

The following program illustrates this: #define PI using System ; nam espace PreprocessorDAppl { class Program { static void Main(string[] args) { #if (PI) Console.WriteLine("PI is defined"); #else Console.WriteLine("PI is not defined"); #endif Console.ReadKey(); } } }

When the above code is compiled and executed, it produces the following result: PI is defined

Conditional Directives You can use the #if directive to create a conditional directive. Conditional directives are useful for testing a symbol or symbols to check if they evaluate to true. If they do evaluate to true, the compiler evaluates all the code between the #if and the next directive. Syntax for conditional directive is: #if sym bol [operator sym bol]...

Where, symbol is the name of the symbol you want to test. You can also use true and false or prepend the symbol with the negation operator. The operator symbol is the operator used for evaluating the symbol. Operators could be either of the following: == equality != inequality && and || or You can also group symbols and operators with parentheses. Conditional directives are used for compiling code for a debug build or when compiling for a specific configuration. A conditional directive beginning with a #if directive must explicitly be terminated with a #endif directive. The following program demonstrates use of conditional directives: #define DEBUG #define VC_V10 using System ; public class TestClass { public static void Main() { #if (DEBUG && !VC_V10) Console.WriteLine("DEBUG is defined"); #elif (!DEBUG && VC_V10) Console.WriteLine("VC_V10 is defined"); #elif (DEBUG && VC_V10) Console.WriteLine("DEBUG and VC_V10 are defined");

Page 7: ILUSTRACIJA - tfzr.uns.ac.rs

#else Console.WriteLine("DEBUG and VC_V10 are not defined"); #endif Console.ReadKey(); } }

When the above code is compiled and executed, it produces the following result: DEBUG and VC_V10 are defined Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

PODEŠAVANJE C# KOMPAJLERA

IZVOR: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/listed-by-category

C# Compiler Options Listed by Category 05/15/2018

The following compiler options are sorted by category. For an alphabetical list, see C# Compiler

Options Listed Alphabetically.

Optimization TAB LE 1

Option Purpose

-filealign Specifies the size of sections in the output file.

-optimize Enables/disables optimizations.

Output Files TAB LE 2

Option Purpose

-deterministic Causes the compiler to output an assembly whose binary content

is identical across compilations if inputs are identical.

-doc Specifies an XML file where processed documentation comments

are to be written.

-out Specifies the output file.

-pathmap Specify a mapping for source path names output by the compiler

-pdb Specifies the file name and location of the .pdb file.

-platform Specify the output platform.

-preferreduilang Specify a language for compiler output.

-refout Generate a reference assembly in addition to the primary

assembly.

-refonly Generate a reference assembly instead of a primary assembly.

-target Specifies the format of the output file using one of five options: -

target:appcontainerexe, -target:exe, -target:library, -

target:module, -target:winexe, or -target:winmdobj.

Page 8: ILUSTRACIJA - tfzr.uns.ac.rs

TAB LE 2

Option Purpose

-modulename:<string> Specify the name of the source module

.NET Framework Assemblies TAB LE 3

Option Purpose

-addmodule Specifies one or more modules to be part of this assembly.

-delaysign Instructs the compiler to add the public key but to leave the assembly unsigned.

-keycontainer Specifies the name of the cryptographic key container.

-keyfile Specifies the filename containing the cryptographic key.

-lib Specifies the location of assemblies referenced by means of -reference.

-nostdlib Instructs the compiler not to import the standard library (mscorlib.dll).

-publicsign Apply a public key without signing the assembly, but set the bit in the assembly

indicating the assembly is signed.

-reference Imports metadata from a file that contains an assembly.

-analyzer Run the analyzers from this assembly (Short form: /a)

-additionalfile Names additional files that don't directly affect code generation but may be used by

analyzers for producing errors or warnings.

-embed Embed all source files in the PDB.

-embed:<file

list>

Embed specific files in the PDB.

Debugging/Error Checking TAB LE 4

Option Purpose

-bugreport Creates a file that contains information that makes it easy to report a bug.

-checked Specifies whether integer arithmetic that overflows the bounds of the data type will cause

an exception at run time.

-debug Instruct the compiler to emit debugging information.

-errorreport Sets error reporting behavior.

-fullpaths Specifies the absolute path to the file in compiler output.

-nowarn Suppresses the compiler's generation of specified warnings.

-warn Sets the warning level.

-warnaserror Promotes warnings to errors.

-ruleset:<file> Specify a ruleset file that disables specific diagnostics.

Preprocessor TAB LE 5

Option Purpose

-define Defines preprocessor symbols.

Resources TAB LE 6

Option Purpose

Page 9: ILUSTRACIJA - tfzr.uns.ac.rs

TAB LE 6

Option Purpose

-link Makes COM type information in specified assemblies available to the project.

-linkresource Creates a link to a managed resource.

-resource Embeds a .NET Framework resource into the output file.

-win32icon Specifies an .ico file to insert into the output file.

-win32res Specifies a Win32 resource to insert into the output file.

Miscellaneous TAB LE 7

Option Purpose

@ Specifies a response file.

-? Lists compiler options to stdout.

-baseaddress Specifies the preferred base address at which to load a DLL.

-codepage Specifies the code page to use for all source code files in the

compilation.

-help Lists compiler options to stdout.

-highentropyva Specifies that the executable file supports address space layout

randomization (ASLR).

-langversion Specify language version: Default, ISO-1, ISO-2, 3, 4, 5, 6, 7, 7.1,

7.2, 7.3, or Latest

-main Specifies the location of the Main method.

-noconfig Instructs the compiler not to compile with csc.rsp.

-nologo Suppresses compiler banner information.

-recurse Searches subdirectories for source files to compile.

-subsystemversion Specifies the minimum version of the subsystem that the executable

file can use.

-unsafe Enables compilation of code that uses the unsafe keyword.

-utf8output Displays compiler output using UTF-8 encoding.

-parallel[+|-] Specifies whether to use concurrent build (+).

-

checksumalgorithm:<alg>

Specify the algorithm for calculating the source file checksum stored

in PDB. Supported values are: SHA1 (default) or SHA256.

Due to collision problems with SHA1, Microsoft recommends

SHA256.

Obsolete Options TAB LE 8

Option Purpose

-incremental Enables incremental compilation.

Page 10: ILUSTRACIJA - tfzr.uns.ac.rs

ZADACI

1. Breakpoint PRIMER (softver za analizu, najjednostavnija varijanta): Postavljena je forma sa standardnim klasama u fajlu Program.cs da se prva pokreće.

Testirati ekransku formu sa 1 zapisom. Postavljen je breakpoint u aplikaciji radi praćenja izvršavanja aplikacije. Klikom levo od linije koda postavlja se crvena oznaka, koja označava breakpoint, tj. tačku prekida i početka monitoringa izvršavanja programa.

Page 11: ILUSTRACIJA - tfzr.uns.ac.rs

Kada smo pokrenuli, program se zaustavlja u okviru te tačke. Nakon toga možemo nastaviti izvršavanje, samo je potrebno da se koristi F11 taster na tastaturi. Nakon izvršavanja svake naredbe prikazuje se desno koliko milisekundi je trebalo da se realizuje ta naredba.

U toku testiranja rada prikazuju se poruke, na narednoj slici su dati komentari koji su povezani sa programskim kodom u VS.NET.

Page 12: ILUSTRACIJA - tfzr.uns.ac.rs

U okviru izvršavanja koda pod monitoringom, prikazuje se uvek aktuelna linija koda i dole registri I procesi koji svoj sadržaj menjaju u skladu sa aktuelnim izvornim kodom.

Takođe, prikazuju se i vrednosti lokalnih promenljivih, a može se izabrati nivo detalja za prikaz kod promenljivih (Search depth).

Page 13: ILUSTRACIJA - tfzr.uns.ac.rs

ZADATAK: Nad korisničkim interfejsom softvera za analizu, za formu koja radi sa stored procedurama realizuj:

Postaviti u program.cs fajl naziv fajla koji se prvi pokreće. Postaviti breakpoint nad prvom naredbom tastera Snimi. Primenom F11 pratiti izvršavanje i

preuzeti screenshot za prva dva koraka koji je omogućio taster F11. Prikazati sadržaj output, locals I processes prozora.

2. ZADATAK - Merenje vremena izvršavanja C# naredbi manuelnom instrumentacijom.

Postaviti novi taster STOPERICA i programski kod za proveru trajanja naredbi. private void StopericaButton_Click(object sender, EventArgs e) { var watch = new System.Diagnostics.Stopwatch(); watch.Start(); string finalnaRec = ""; for (int i = 0; i < 1000; i++) { finalnaRec = finalnaRec + " " + i.ToString (); } watch.Stop(); MessageBox.Show (watch.ElapsedMilliseconds.ToString() + " ms"); } Rezultat:

Page 14: ILUSTRACIJA - tfzr.uns.ac.rs

ZADATAK: Primeniti programski kod sa tastera STOPERICA nad tasterom za snimanje kod svih 5 vrsta formi u desktop C# aplikaciji koja je data za analizu i prikazati izveštaj u formi tabele.

TIP FORME Trajanje celokupnog koda metode taster SNIMI (ms)

NAPOMENE

Forma sa standardnim klasama

Forma sa stored procedurom

Forma sa sopstvenom bibliotekom DBUtils

Forma sa Višeslojnim sopstvenim klasama

Forma sa klasama Entity Frameworka