SlideShare a Scribd company logo
1 of 38
Download to read offline
Tool Development
Chapter 09: Localization & Testing
Nick Prühs
Assignment Solution #8
DEMO
2 / 58
Objectives
• To understand how to globalize and localize WPF
applications
• To learn how to properly set up automatic testing
for your WPF applications
3 / 58
Globalization & Localization
• When you limit your product's availability to only
one language, you limit your potential customer
base to a fraction of our world’s 6.5 billion
population.
• If you want your applications to reach a global
audience, cost-effective localization of your product
is one of the best and most economical ways to
reach more customers.
4 / 58
Globalization & Localization
• Globalization is the design and development of
applications that perform in multiple locations. For
example, globalization supports localized user
interfaces and regional data for users in different
cultures.
• Localization is the translation of application
resources into localized versions for the specific
cultures that the application supports.
5 / 58
WPF UI Design Best Practice
• Write your UI in XAML; avoid creating UI in code.
• Avoid using absolute positions and fixed sizes to lay out
content; instead, use relative or automatic sizing.
• Provide extra space in margins because localized text
often requires more space.
• Enable TextWrapping on TextBlock to avoid clipping.
• Set the xml:lang attribute.
• Changes the behavior of hyphenation, spell checking, number
substitution, complex script shaping, and font fallback.
6 / 58
Localizing WPF Applications
1. Add a Uid property by running msbuild /t:updateuid
ProjectName.csproj in a developer command shell.
2. Set <UICulture>en-US</UICulture> in some PropertyGroup of your
csproj file.
3. Build the application.
4. Download and build LocBaml from http://msdn.microsoft.com/en-
us/library/vstudio/ms771568(v=vs.90).aspx
5. Run LocBaml /parse en-USProjectName.resources.dll at the
location of the application binary (.exe).
6. Localize the resulting CSV file.
7. Generate new satellite assembly with LocBaml.exe /generate en-
USProjectName.resources.dll /trans:ProjectName.resources.CSV
/out: . /cul:de-DE
8. Copy resulting DLL to corresponding language folder.
7 / 58
LocBaml CSV Fields
• BAML Name. The name of the BAML resource with
respect to the source language satellite assembly.
• Resource Key. The localized resource identifier.
• Category. The value type.
• Readability. Whether the value can be read by a
localizer.
• Modifiability. Whether the value can be modified by a
localizer.
• Comments. Additional description of the value to help
determine how a value is localized.
• Value. The text value to translate to the desired culture.
8 / 58
Gotcha!
Both the LocBaml tool and your
application must target the same
platform and .NET framework!
9 / 78
Gotcha!
The locale specified for the LocBaml
tool and the localization folder
must match!
10 / 78
Localizing the Level Editor
DEMO
11 / 58
“How do you automate a client-server, distributed,
persistent, sharded, asynchronous, realtime, scalable
system?”
12 / 58
“How do you automate a client-server, distributed,
persistent, sharded, asynchronous, realtime, scalable
system?”
“Very carefully.”
- David Press, CCP Games
13 / 58
Unit Testing
• Method by which individual units of source code
are tested to determine if they are fit for use
• Unit of source code is the smallest testable part of
an application (e.g. method)
• Created by programmers during the development
process
14 / 58
Unit Testing
• Ideally, each test case is independent from the
others
• Substitutes such as mocks can be used to assist
testing a module in isolation (e.g. database, mails)
• Can be implemented as part of automated builds
15 / 58
Advantages of Unit Testing
 Finds problems early
• Test Driven Development
 Facilitates changes
• Can be run before each commit or build
• In combination with source control, can identify the
revision (and originator) that broke the code
16 / 58
Limits of Unit Testing
• Won’t catch every error in the program
• Won’t catch integration errors
• Combinatorial problem
• Every boolean decision statement requires at least two
tests
• Can’t test non-deterministic or concurrency
problems
17 / 58
Limits of Unit Testing
• Setting up realistic and useful tests is a challenge
• Test case failures need to be reviewed daily and
addressed immediately
• Embedded system software presents a unique
challenge
• Software is being developed on a different platform than
the one it will eventually run on
18 / 58
Unit Testing with NUnit
• Unit Testing framework for all .NET languages
• Initially ported from JUnit
• Written entirely in C#
• Stand-alone tools and R# integration
19 / 58
Setting up NUnit
1. Add new Class Library project to the solution.
2. Add reference to
bin/framework/nunit.framework.dll.
20 / 58
NUnit Test Class Design
• Public
• Default constructor
21 / 58
NUnit Test Method Design
• [Test] attribute
• Return void
• No parameters
22 / 58
NUnit Test Example
C#
23 / 58
namespace LevelEditor.Tests
{
using LevelEditor.Model;
using NUnit.Framework;
public class MapTest
{
[Test]
public void TestMapConstructor()
{
// Create new map.
const int Width = 32;
const int Height = 16;
Map map = new Map(Width, Height);
// Check width and height.
Assert.AreEqual(Width, map.Width);
Assert.AreEqual(Height, map.Height);
}
}
}
NUnit Assertions
• AreEqual, AreNotEqual
• AreSame, AreNotSame
• IsTrue, IsFalse
• Greater, GreaterOrEqual
• Less, LessOrEqual
• IsEmpty, IsNotEmpty
• IsNull, IsNotNull
• Contains
• Fail, Inconclusive
24 / 58
Expected Exceptions
C#
25 / 58
[Test]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
public void TestNegativeWidth()
{
Map map = new Map(-10, 20);
}
SetUp and TearDown
C#
26 / 58
public class MapTest
{
private const int Height = 16;
private const int Width = 32;
private Map map;
[SetUp]
public void SetUp()
{
this.map = new Map(Width, Height);
}
[Test]
public void TestTileIndexer()
{
const int X = 1;
const int Y = 2;
var mapTile = new MapTile(X, Y, "Desert");
this.map[X, Y] = mapTile;
Assert.AreEqual(mapTile, this.map[X, Y]);
}
}
Hint
Override Equals in types whose
objects you need to compare!
27 / 78
NUnit Test Tool
28 / 78
NUnit Console
Console Output
29 / 58
D:DevRepositoriesSAE-ToolDevelopmentVendorNUnit-2.6.3bin>nunit-console-x86.exe
......SourceLevelEditor.TestsbinDebugLevelEditor.Tests.dll
NUnit-Console version 2.6.3.13283
Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 6.2.9200.0
CLR Version: 2.0.50727.7905 ( Net 3.5 )
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-3.5
...
Tests run: 3, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.046059608766156 seconds
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
NUnit & Visual Studio
30 / 78
NUnit & Visual Studio
31 / 78
Test Driven Development
1. Write an (initially failing) automated test
case that defines a desired improvement or new
function.
2. Produce the minimum amount of code required
to pass that test.
3. Refactor the new code to acceptable standards.
32 / 58
Advantages of TDD
 Client-first development
 Taking small steps
 All written code is covered by at least one test
 Can lead to more modularized code
33 / 58
Limits of TDD
• Support of the entire team is essential
• Test are typically created by the developer who is
writing the code being tested, and may therefore
share the same blind spots with the code
• Maintenance overhead
34 / 58
Assignment #9
Unit Tests
1. Download NUnit from
http://nunit.org/index.php?p=download and add it to
your project.
2. Write a unit test asserting the construction of maps
with correct width and height.
3. Write a unit test asserting the failure of construction
of maps with negative width or height.
35 / 58
References
• MSDN. WPF Globalization and Localization Overview.
http://msdn.microsoft.com/en-
us/library/ms788718(v=vs.110).aspx, May 2016.
• MSDN. How to: Localize an Application.
http://msdn.microsoft.com/en-
us/library/ms746621(v=vs.110).aspx, May 2016.
• Wikipedia. Unit testing.
http://en.wikipedia.org/wiki/Unit_testing, December 12, 2013.
• Poole. Getting Started with Nunit.
http://www.nunit.org/index.php?p=getStarted&r=2.6.3, May
2016.
• Wikipedia. Test-driven development.
http://en.wikipedia.org/wiki/Test-driven_development,
December 14, 2013.
36 / 58
Thank you!
http://www.npruehs.de
https://github.com/npruehs
@npruehs
dev@npruehs.de
5 Minute Review Session
• What is the difference between Globalization and
Localization?
• Name a few globalization best practices!
• What are the main advantages of unit testing?
• What are the most important limits of unit tests?
• Explain the process of Test Driven Development!
• What are the upsides and downsides of TDD?
38 / 58

More Related Content

What's hot

Unit testing with NUnit
Unit testing with NUnitUnit testing with NUnit
Unit testing with NUnitkleinron
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system softwaregayathri ravi
 
Model For Applying Unit Test
Model For Applying Unit TestModel For Applying Unit Test
Model For Applying Unit TestHieu Le Trung
 
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in IndustryAssessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in IndustryDharmalingam Ganesan
 
Model-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight ExecutiveModel-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight ExecutiveDharmalingam Ganesan
 
Introduction to Unified Functional Testing 12 (UFT)
Introduction to Unified Functional Testing 12 (UFT)Introduction to Unified Functional Testing 12 (UFT)
Introduction to Unified Functional Testing 12 (UFT)Archana Krushnan
 
Practical unit testing in c & c++
Practical unit testing in c & c++Practical unit testing in c & c++
Practical unit testing in c & c++Matt Hargett
 
SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)Amr E. Mohamed
 
Automated testing overview
Automated testing overviewAutomated testing overview
Automated testing overviewAlex Pop
 
UFT An advance version of QTP
UFT  An advance version of QTPUFT  An advance version of QTP
UFT An advance version of QTPRita Singh
 
Automation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadDurga Prasad
 
Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2Dharmalingam Ganesan
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Clemens Reijnen
 
UFT- New features and comparison with QTP
UFT- New features and comparison with QTPUFT- New features and comparison with QTP
UFT- New features and comparison with QTPRita Singh
 
Types of test tools
Types of test toolsTypes of test tools
Types of test toolsVaibhav Dash
 

What's hot (19)

N Unit Presentation
N Unit PresentationN Unit Presentation
N Unit Presentation
 
Unit testing with NUnit
Unit testing with NUnitUnit testing with NUnit
Unit testing with NUnit
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system software
 
Model For Applying Unit Test
Model For Applying Unit TestModel For Applying Unit Test
Model For Applying Unit Test
 
Ss debuggers
Ss debuggersSs debuggers
Ss debuggers
 
Nunit
NunitNunit
Nunit
 
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in IndustryAssessing Model-Based Testing: An Empirical Study Conducted in Industry
Assessing Model-Based Testing: An Empirical Study Conducted in Industry
 
Model-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight ExecutiveModel-based Testing of a Software Bus - Applied on Core Flight Executive
Model-based Testing of a Software Bus - Applied on Core Flight Executive
 
Introduction to Unified Functional Testing 12 (UFT)
Introduction to Unified Functional Testing 12 (UFT)Introduction to Unified Functional Testing 12 (UFT)
Introduction to Unified Functional Testing 12 (UFT)
 
Practical unit testing in c & c++
Practical unit testing in c & c++Practical unit testing in c & c++
Practical unit testing in c & c++
 
SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 20_ Test-Driven Development (TDD)
 
AAA Automated Testing
AAA Automated TestingAAA Automated Testing
AAA Automated Testing
 
Automated testing overview
Automated testing overviewAutomated testing overview
Automated testing overview
 
UFT An advance version of QTP
UFT  An advance version of QTPUFT  An advance version of QTP
UFT An advance version of QTP
 
Automation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in Hyderabad
 
Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2Automated testing of NASA Software - part 2
Automated testing of NASA Software - part 2
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
 
UFT- New features and comparison with QTP
UFT- New features and comparison with QTPUFT- New features and comparison with QTP
UFT- New features and comparison with QTP
 
Types of test tools
Types of test toolsTypes of test tools
Types of test tools
 

Similar to Tool Localization Testing

TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalTLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalAnna Royzman
 
UVM_Full_Print_n.pptx
UVM_Full_Print_n.pptxUVM_Full_Print_n.pptx
UVM_Full_Print_n.pptxnikitha992646
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projectsVincent Massol
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Updatejamieayre
 
Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Vincent Massol
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...DicodingEvent
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code cleanBrett Child
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile DeveloperBSGAfrica
 
Jenkins_1679702972.pdf
Jenkins_1679702972.pdfJenkins_1679702972.pdf
Jenkins_1679702972.pdfMahmoudAlnmr1
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBaskar K
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScriptRob Scaduto
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_ContainersGrace Jansen
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing ToolsDr Ganesh Iyer
 
JLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersJLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersGrace Jansen
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented SoftwarePraveen Penumathsa
 
Automation Testing with Test Complete
Automation Testing with Test CompleteAutomation Testing with Test Complete
Automation Testing with Test CompleteVartika Saxena
 

Similar to Tool Localization Testing (20)

TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalTLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
 
UVM_Full_Print_n.pptx
UVM_Full_Print_n.pptxUVM_Full_Print_n.pptx
UVM_Full_Print_n.pptx
 
New types of tests for Java projects
New types of tests for Java projectsNew types of tests for Java projects
New types of tests for Java projects
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
 
Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019Advanced Java Testing @ POSS 2019
Advanced Java Testing @ POSS 2019
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
Mannu_Kumar_CV
Mannu_Kumar_CVMannu_Kumar_CV
Mannu_Kumar_CV
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code clean
 
Enter the mind of an Agile Developer
Enter the mind of an Agile DeveloperEnter the mind of an Agile Developer
Enter the mind of an Agile Developer
 
Jenkins_1679702972.pdf
Jenkins_1679702972.pdfJenkins_1679702972.pdf
Jenkins_1679702972.pdf
 
jenkins.pdf
jenkins.pdfjenkins.pdf
jenkins.pdf
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_Containers
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Continuous Testing With Terraform
Continuous Testing With TerraformContinuous Testing With Terraform
Continuous Testing With Terraform
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing Tools
 
JLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersJLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containers
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
 
Automation Testing with Test Complete
Automation Testing with Test CompleteAutomation Testing with Test Complete
Automation Testing with Test Complete
 

More from Nick Pruehs

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsNick Pruehs
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceNick Pruehs
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesNick Pruehs
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayNick Pruehs
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorNick Pruehs
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkNick Pruehs
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud DevelopmentNick Pruehs
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - GitNick Pruehs
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameNick Pruehs
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with PonyNick Pruehs
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationNick Pruehs
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsNick Pruehs
 
Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)Nick Pruehs
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard DoNick Pruehs
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsNick Pruehs
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - GitNick Pruehs
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - ShadersNick Pruehs
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game PhysicsNick Pruehs
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - LocalizationNick Pruehs
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AINick Pruehs
 

More from Nick Pruehs (20)

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
 
Unreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User InterfaceUnreal Engine Basics 05 - User Interface
Unreal Engine Basics 05 - User Interface
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - GameplayUnreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game Framework
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - Git
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with Pony
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
 
Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard Do
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - Git
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - Shaders
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game Physics
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - Localization
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AI
 

Recently uploaded

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

Tool Localization Testing

  • 1. Tool Development Chapter 09: Localization & Testing Nick Prühs
  • 3. Objectives • To understand how to globalize and localize WPF applications • To learn how to properly set up automatic testing for your WPF applications 3 / 58
  • 4. Globalization & Localization • When you limit your product's availability to only one language, you limit your potential customer base to a fraction of our world’s 6.5 billion population. • If you want your applications to reach a global audience, cost-effective localization of your product is one of the best and most economical ways to reach more customers. 4 / 58
  • 5. Globalization & Localization • Globalization is the design and development of applications that perform in multiple locations. For example, globalization supports localized user interfaces and regional data for users in different cultures. • Localization is the translation of application resources into localized versions for the specific cultures that the application supports. 5 / 58
  • 6. WPF UI Design Best Practice • Write your UI in XAML; avoid creating UI in code. • Avoid using absolute positions and fixed sizes to lay out content; instead, use relative or automatic sizing. • Provide extra space in margins because localized text often requires more space. • Enable TextWrapping on TextBlock to avoid clipping. • Set the xml:lang attribute. • Changes the behavior of hyphenation, spell checking, number substitution, complex script shaping, and font fallback. 6 / 58
  • 7. Localizing WPF Applications 1. Add a Uid property by running msbuild /t:updateuid ProjectName.csproj in a developer command shell. 2. Set <UICulture>en-US</UICulture> in some PropertyGroup of your csproj file. 3. Build the application. 4. Download and build LocBaml from http://msdn.microsoft.com/en- us/library/vstudio/ms771568(v=vs.90).aspx 5. Run LocBaml /parse en-USProjectName.resources.dll at the location of the application binary (.exe). 6. Localize the resulting CSV file. 7. Generate new satellite assembly with LocBaml.exe /generate en- USProjectName.resources.dll /trans:ProjectName.resources.CSV /out: . /cul:de-DE 8. Copy resulting DLL to corresponding language folder. 7 / 58
  • 8. LocBaml CSV Fields • BAML Name. The name of the BAML resource with respect to the source language satellite assembly. • Resource Key. The localized resource identifier. • Category. The value type. • Readability. Whether the value can be read by a localizer. • Modifiability. Whether the value can be modified by a localizer. • Comments. Additional description of the value to help determine how a value is localized. • Value. The text value to translate to the desired culture. 8 / 58
  • 9. Gotcha! Both the LocBaml tool and your application must target the same platform and .NET framework! 9 / 78
  • 10. Gotcha! The locale specified for the LocBaml tool and the localization folder must match! 10 / 78
  • 11. Localizing the Level Editor DEMO 11 / 58
  • 12. “How do you automate a client-server, distributed, persistent, sharded, asynchronous, realtime, scalable system?” 12 / 58
  • 13. “How do you automate a client-server, distributed, persistent, sharded, asynchronous, realtime, scalable system?” “Very carefully.” - David Press, CCP Games 13 / 58
  • 14. Unit Testing • Method by which individual units of source code are tested to determine if they are fit for use • Unit of source code is the smallest testable part of an application (e.g. method) • Created by programmers during the development process 14 / 58
  • 15. Unit Testing • Ideally, each test case is independent from the others • Substitutes such as mocks can be used to assist testing a module in isolation (e.g. database, mails) • Can be implemented as part of automated builds 15 / 58
  • 16. Advantages of Unit Testing  Finds problems early • Test Driven Development  Facilitates changes • Can be run before each commit or build • In combination with source control, can identify the revision (and originator) that broke the code 16 / 58
  • 17. Limits of Unit Testing • Won’t catch every error in the program • Won’t catch integration errors • Combinatorial problem • Every boolean decision statement requires at least two tests • Can’t test non-deterministic or concurrency problems 17 / 58
  • 18. Limits of Unit Testing • Setting up realistic and useful tests is a challenge • Test case failures need to be reviewed daily and addressed immediately • Embedded system software presents a unique challenge • Software is being developed on a different platform than the one it will eventually run on 18 / 58
  • 19. Unit Testing with NUnit • Unit Testing framework for all .NET languages • Initially ported from JUnit • Written entirely in C# • Stand-alone tools and R# integration 19 / 58
  • 20. Setting up NUnit 1. Add new Class Library project to the solution. 2. Add reference to bin/framework/nunit.framework.dll. 20 / 58
  • 21. NUnit Test Class Design • Public • Default constructor 21 / 58
  • 22. NUnit Test Method Design • [Test] attribute • Return void • No parameters 22 / 58
  • 23. NUnit Test Example C# 23 / 58 namespace LevelEditor.Tests { using LevelEditor.Model; using NUnit.Framework; public class MapTest { [Test] public void TestMapConstructor() { // Create new map. const int Width = 32; const int Height = 16; Map map = new Map(Width, Height); // Check width and height. Assert.AreEqual(Width, map.Width); Assert.AreEqual(Height, map.Height); } } }
  • 24. NUnit Assertions • AreEqual, AreNotEqual • AreSame, AreNotSame • IsTrue, IsFalse • Greater, GreaterOrEqual • Less, LessOrEqual • IsEmpty, IsNotEmpty • IsNull, IsNotNull • Contains • Fail, Inconclusive 24 / 58
  • 25. Expected Exceptions C# 25 / 58 [Test] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void TestNegativeWidth() { Map map = new Map(-10, 20); }
  • 26. SetUp and TearDown C# 26 / 58 public class MapTest { private const int Height = 16; private const int Width = 32; private Map map; [SetUp] public void SetUp() { this.map = new Map(Width, Height); } [Test] public void TestTileIndexer() { const int X = 1; const int Y = 2; var mapTile = new MapTile(X, Y, "Desert"); this.map[X, Y] = mapTile; Assert.AreEqual(mapTile, this.map[X, Y]); } }
  • 27. Hint Override Equals in types whose objects you need to compare! 27 / 78
  • 29. NUnit Console Console Output 29 / 58 D:DevRepositoriesSAE-ToolDevelopmentVendorNUnit-2.6.3bin>nunit-console-x86.exe ......SourceLevelEditor.TestsbinDebugLevelEditor.Tests.dll NUnit-Console version 2.6.3.13283 Copyright (C) 2002-2012 Charlie Poole. Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright (C) 2000-2002 Philip Craig. All Rights Reserved. Runtime Environment - OS Version: Microsoft Windows NT 6.2.9200.0 CLR Version: 2.0.50727.7905 ( Net 3.5 ) ProcessModel: Default DomainUsage: Single Execution Runtime: net-3.5 ... Tests run: 3, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.046059608766156 seconds Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
  • 30. NUnit & Visual Studio 30 / 78
  • 31. NUnit & Visual Studio 31 / 78
  • 32. Test Driven Development 1. Write an (initially failing) automated test case that defines a desired improvement or new function. 2. Produce the minimum amount of code required to pass that test. 3. Refactor the new code to acceptable standards. 32 / 58
  • 33. Advantages of TDD  Client-first development  Taking small steps  All written code is covered by at least one test  Can lead to more modularized code 33 / 58
  • 34. Limits of TDD • Support of the entire team is essential • Test are typically created by the developer who is writing the code being tested, and may therefore share the same blind spots with the code • Maintenance overhead 34 / 58
  • 35. Assignment #9 Unit Tests 1. Download NUnit from http://nunit.org/index.php?p=download and add it to your project. 2. Write a unit test asserting the construction of maps with correct width and height. 3. Write a unit test asserting the failure of construction of maps with negative width or height. 35 / 58
  • 36. References • MSDN. WPF Globalization and Localization Overview. http://msdn.microsoft.com/en- us/library/ms788718(v=vs.110).aspx, May 2016. • MSDN. How to: Localize an Application. http://msdn.microsoft.com/en- us/library/ms746621(v=vs.110).aspx, May 2016. • Wikipedia. Unit testing. http://en.wikipedia.org/wiki/Unit_testing, December 12, 2013. • Poole. Getting Started with Nunit. http://www.nunit.org/index.php?p=getStarted&r=2.6.3, May 2016. • Wikipedia. Test-driven development. http://en.wikipedia.org/wiki/Test-driven_development, December 14, 2013. 36 / 58
  • 38. 5 Minute Review Session • What is the difference between Globalization and Localization? • Name a few globalization best practices! • What are the main advantages of unit testing? • What are the most important limits of unit tests? • Explain the process of Test Driven Development! • What are the upsides and downsides of TDD? 38 / 58