RESTful tīmekļa risinājumiKrišs RauhvargersViena no atvērto tīmekļa risinājumu pamatidejām, kas balstīta resursu korektā identificēšanā un HTTP protokola iespēju pilnvērtīgā izmantošanā.
Analysis and comparison of microservice data exchange formats on Enduro/X pla...Einars LeckisThe thesis analyzes and compares the microservice data exchange formats. The work
contains a study of what data exchange formats are available, what characteristics to consider
when choosing these formats. Each of the selected data exchange formats is implemented in a
microservice architecture environment where measurements are made on the performance of a
particular data exchange format by serialization of data, deserialization between service calls.
The end results are compared and conclusions are drawn on which of these data exchange
formats is better, which one would be better suited to specific situations.
The analytical section of the thesis examines the Enduro/X UBF data exchange format, which
was found to be incomplete during the research. Based on these shortcomings, design is being
developed.
The main body of the thesis is 82 pages, 41 pictures, 18 tables, 43 titles of information sources and 19 appendices.
2024 Trend Updates: What Really Works In SEO & Content MarketingSearch Engine JournalThe document outlines key SEO and content marketing trends for 2024, emphasizing the impact of AI, the importance of E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness), and a shift towards user-centric content strategies. It advises against focusing on outdated trends like voice search and stresses the need for creating value-driven, authoritative content. Additionally, it highlights the need to leverage AI as a supportive tool rather than relying solely on it for content creation.
Storytelling For The Web: Integrate Storytelling in your Design ProcessChiara AliottaThe document outlines a livestream presentation by Chiara Aliotta on integrating storytelling into web design to enhance user experiences. It covers the storytelling process for designers, emphasizing aspects such as understanding the audience, structuring narratives, and creating emotional connections. The presentation also includes case studies and practical examples to demonstrate effective storytelling in UX/UI design.
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...OECD Directorate for Financial and Enterprise AffairsThis presentation by Thibault Schrepel, Associate Professor of Law at Vrije Universiteit Amsterdam University, was made during the discussion “Artificial Intelligence, Data and Competition” held at the 143rd meeting of the OECD Competition Committee on 12 June 2024. More papers and presentations on the topic can be found at oe.cd/aicomp.
This presentation was uploaded with the author’s consent.
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...SocialHRCampThe document discusses leveraging AI to enhance employee wellness through data analytics, automating tasks, and personalized wellness apps, emphasizing the shared responsibility of employee well-being between leaders and organizations. It outlines best practices for using AI in wellness strategies, including ensuring data privacy and security, understanding employee needs, and promoting inclusivity. Lydia Di Francesco, a wellness specialist, shares insights to optimize workplace wellness strategy using AI-driven data analytics and encourages collaboration and transparency.
2024 State of Marketing Report – by HubspotMarius SescuThe State of Marketing 2024 report highlights the transformative impact of AI and automation, emphasizing the importance of personalization and engagement to drive growth in a competitive landscape. Marketers are focusing on optimizing budgets, leveraging social media for brand awareness, and utilizing AI tools to enhance efficiency across tasks. Key trends for 2024 include the rise of experiential marketing, content creation that meets user needs, and strengthened connections through personalized customer experiences.
Everything You Need To Know About ChatGPTExpeed SoftwareChatGPT is an AI chatbot developed by OpenAI, built on advanced language models to facilitate human-like conversational interactions. Launched in November 2022, it utilizes a transformer architecture to understand and generate text, with applications ranging from content creation to customer service. Despite its capabilities, there are concerns about potential misuse and biases in its responses, which OpenAI aims to mitigate through moderation and user feedback.
Product Design Trends in 2024 | Teenage EngineeringsPixeldartsThe realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNowThe November 2023 mental health report indicates that 70% of respondents rate their mental health as 'good' or 'excellent,' with higher diagnoses reported among African Americans and non-Hispanic whites compared to Hispanics and Asians. Younger generations, particularly Gen Z and millennials, are more likely to experience mental health challenges, seek information online, and report that their mental health impacts their work and relationships. Half of the respondents feel comfortable discussing their mental health with professionals, although Gen Z shows the least comfort in this area.
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartworkCreative operations teams expect increased AI use in 2024. Currently, over half of tasks are not AI-enabled, but this is expected to decrease in the coming year. ChatGPT is the most popular AI tool currently. Business leaders are more actively exploring AI benefits than individual contributors. Most respondents do not believe AI will impact workforce size in 2024. However, some inhibitions still exist around AI accuracy and lack of understanding. Creatives primarily want to use AI to save time on mundane tasks and boost productivity.
Skeleton Culture CodeSkeleton TechnologiesOrganizational culture includes values, norms, systems, symbols, language, assumptions, beliefs, and habits that influence employee behaviors and how people interpret those behaviors. It is important because culture can help or hinder a company's success. Some key aspects of Netflix's culture that help it achieve results include hiring smartly so every position has stars, focusing on attitude over just aptitude, and having a strict policy against peacocks, whiners, and jerks.
PEPSICO Presentation to CAGNY Conference Feb 2024Neil KimberleyPepsiCo provided a safe harbor statement noting that any forward-looking statements are based on currently available information and are subject to risks and uncertainties. It also provided information on non-GAAP measures and directing readers to its website for disclosure and reconciliation. The document then discussed PepsiCo's business overview, including that it is a global beverage and convenient food company with iconic brands, $91 billion in net revenue in 2023, and nearly $14 billion in core operating profit. It operates through a divisional structure with a focus on local consumers.
Content Methodology: A Best Practices Report (Webinar)contentlyThis document provides an overview of content methodology best practices. It defines content methodology as establishing objectives, KPIs, and a culture of continuous learning and iteration. An effective methodology focuses on connecting with audiences, creating optimal content, and optimizing processes. It also discusses why a methodology is needed due to the competitive landscape, proliferation of channels, and opportunities for improvement. Components of an effective methodology include defining objectives and KPIs, audience analysis, identifying opportunities, and evaluating resources. The document concludes with recommendations around creating a content plan, testing and optimizing content over 90 days.
How to Prepare For a Successful Job Search for 2024Albert QianThe document provides guidance on preparing a job search for 2024. It discusses the state of the job market, focusing on growth in AI and healthcare but also continued layoffs. It recommends figuring out what you want to do by researching interests and skills, then conducting informational interviews. The job search should involve building a personal brand on LinkedIn, actively applying to jobs, tailoring resumes and interviews, maintaining job hunting as a habit, and continuing self-improvement. Once hired, the document advises setting new goals and keeping skills and networking active in case of future opportunities.
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)The 2024 social media marketing trends report highlights significant shifts influenced by generative AI, including the emergence of personalized content, the rise of virtual influencers, and a stronger focus on user-generated content. Insights were gathered from 33 experts across 23 leading independent agencies, providing a perspective that emphasizes creativity and authenticity in marketing strategies. Key trends also include the blending of B2B and B2C approaches, reflecting changes in consumer behavior and the evolving landscape of social media engagement.
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine JournalThe document discusses trends in paid search for 2024, highlighting changes in user behavior, the implications for financial services, and privacy challenges. It emphasizes the importance of adapting search strategies, utilizing AI-driven tools like performance max and smart bidding, and leveraging first-party data for better marketing efficacy. Key takeaways include holistic SEO and SEM approaches, monitoring shifting user intents, and the need for continuous performance evaluation.
5 Public speaking tips from TED - Visualized summarySpeakerHubThe document outlines five public speaking tips from Chris Anderson, TED Talks curator, emphasizing the importance of eye contact, vulnerability, humor, humility, and storytelling. These skills are presented as essential for engaging audiences effectively and are increasingly valuable in today's economy. The article posits that mastering these techniques can enhance speakers' ability to communicate ideas powerfully.
ChatGPT and the Future of Work - Clark Boyd Clark BoydThe document provides an overview of generative AI, particularly focusing on ChatGPT and its implications for business and the job market. It discusses the rapid growth of generative AI, its applications in marketing, and the skills needed for the AI era while addressing potential job displacement and the need for adaptation. The agenda includes a Q&A session and emphasizes rethinking work in collaboration with AI technology.
Getting into the tech field. what next Tessa MeroThe document provides career advice for getting into the tech field, including:
- Doing projects and internships in college to build a portfolio.
- Learning about different roles and technologies through industry research.
- Contributing to open source projects to build experience and network.
- Developing a personal brand through a website and social media presence.
- Networking through events, communities, and finding a mentor.
- Practicing interviews through mock interviews and whiteboarding coding questions.
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray1. Core updates from Google periodically change how its algorithms assess and rank websites and pages. This can impact rankings through shifts in user intent, site quality issues being caught up to, world events influencing queries, and overhauls to search like the E-A-T framework.
2. There are many possible user intents beyond just transactional, navigational and informational. Identifying intent shifts is important during core updates. Sites may need to optimize for new intents through different content types and sections.
3. Responding effectively to core updates requires analyzing "before and after" data to understand changes, identifying new intents or page types, and ensuring content matches appropriate intents across video, images, knowledge graphs and more.
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACCThe document provides essential tips on how to handle difficult conversations in a workplace setting, emphasizing the importance of preparation, environment, and timing. It highlights that many employees dread such conversations, often leading to avoidance and worsening situations. Ultimately, the guide aims to promote positive outcomes while maintaining professional relationships.
2024 Trend Updates: What Really Works In SEO & Content MarketingSearch Engine JournalThe document outlines key SEO and content marketing trends for 2024, emphasizing the impact of AI, the importance of E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness), and a shift towards user-centric content strategies. It advises against focusing on outdated trends like voice search and stresses the need for creating value-driven, authoritative content. Additionally, it highlights the need to leverage AI as a supportive tool rather than relying solely on it for content creation.
Storytelling For The Web: Integrate Storytelling in your Design ProcessChiara AliottaThe document outlines a livestream presentation by Chiara Aliotta on integrating storytelling into web design to enhance user experiences. It covers the storytelling process for designers, emphasizing aspects such as understanding the audience, structuring narratives, and creating emotional connections. The presentation also includes case studies and practical examples to demonstrate effective storytelling in UX/UI design.
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...OECD Directorate for Financial and Enterprise AffairsThis presentation by Thibault Schrepel, Associate Professor of Law at Vrije Universiteit Amsterdam University, was made during the discussion “Artificial Intelligence, Data and Competition” held at the 143rd meeting of the OECD Competition Committee on 12 June 2024. More papers and presentations on the topic can be found at oe.cd/aicomp.
This presentation was uploaded with the author’s consent.
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...SocialHRCampThe document discusses leveraging AI to enhance employee wellness through data analytics, automating tasks, and personalized wellness apps, emphasizing the shared responsibility of employee well-being between leaders and organizations. It outlines best practices for using AI in wellness strategies, including ensuring data privacy and security, understanding employee needs, and promoting inclusivity. Lydia Di Francesco, a wellness specialist, shares insights to optimize workplace wellness strategy using AI-driven data analytics and encourages collaboration and transparency.
2024 State of Marketing Report – by HubspotMarius SescuThe State of Marketing 2024 report highlights the transformative impact of AI and automation, emphasizing the importance of personalization and engagement to drive growth in a competitive landscape. Marketers are focusing on optimizing budgets, leveraging social media for brand awareness, and utilizing AI tools to enhance efficiency across tasks. Key trends for 2024 include the rise of experiential marketing, content creation that meets user needs, and strengthened connections through personalized customer experiences.
Everything You Need To Know About ChatGPTExpeed SoftwareChatGPT is an AI chatbot developed by OpenAI, built on advanced language models to facilitate human-like conversational interactions. Launched in November 2022, it utilizes a transformer architecture to understand and generate text, with applications ranging from content creation to customer service. Despite its capabilities, there are concerns about potential misuse and biases in its responses, which OpenAI aims to mitigate through moderation and user feedback.
Product Design Trends in 2024 | Teenage EngineeringsPixeldartsThe realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNowThe November 2023 mental health report indicates that 70% of respondents rate their mental health as 'good' or 'excellent,' with higher diagnoses reported among African Americans and non-Hispanic whites compared to Hispanics and Asians. Younger generations, particularly Gen Z and millennials, are more likely to experience mental health challenges, seek information online, and report that their mental health impacts their work and relationships. Half of the respondents feel comfortable discussing their mental health with professionals, although Gen Z shows the least comfort in this area.
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartworkCreative operations teams expect increased AI use in 2024. Currently, over half of tasks are not AI-enabled, but this is expected to decrease in the coming year. ChatGPT is the most popular AI tool currently. Business leaders are more actively exploring AI benefits than individual contributors. Most respondents do not believe AI will impact workforce size in 2024. However, some inhibitions still exist around AI accuracy and lack of understanding. Creatives primarily want to use AI to save time on mundane tasks and boost productivity.
Skeleton Culture CodeSkeleton TechnologiesOrganizational culture includes values, norms, systems, symbols, language, assumptions, beliefs, and habits that influence employee behaviors and how people interpret those behaviors. It is important because culture can help or hinder a company's success. Some key aspects of Netflix's culture that help it achieve results include hiring smartly so every position has stars, focusing on attitude over just aptitude, and having a strict policy against peacocks, whiners, and jerks.
PEPSICO Presentation to CAGNY Conference Feb 2024Neil KimberleyPepsiCo provided a safe harbor statement noting that any forward-looking statements are based on currently available information and are subject to risks and uncertainties. It also provided information on non-GAAP measures and directing readers to its website for disclosure and reconciliation. The document then discussed PepsiCo's business overview, including that it is a global beverage and convenient food company with iconic brands, $91 billion in net revenue in 2023, and nearly $14 billion in core operating profit. It operates through a divisional structure with a focus on local consumers.
Content Methodology: A Best Practices Report (Webinar)contentlyThis document provides an overview of content methodology best practices. It defines content methodology as establishing objectives, KPIs, and a culture of continuous learning and iteration. An effective methodology focuses on connecting with audiences, creating optimal content, and optimizing processes. It also discusses why a methodology is needed due to the competitive landscape, proliferation of channels, and opportunities for improvement. Components of an effective methodology include defining objectives and KPIs, audience analysis, identifying opportunities, and evaluating resources. The document concludes with recommendations around creating a content plan, testing and optimizing content over 90 days.
How to Prepare For a Successful Job Search for 2024Albert QianThe document provides guidance on preparing a job search for 2024. It discusses the state of the job market, focusing on growth in AI and healthcare but also continued layoffs. It recommends figuring out what you want to do by researching interests and skills, then conducting informational interviews. The job search should involve building a personal brand on LinkedIn, actively applying to jobs, tailoring resumes and interviews, maintaining job hunting as a habit, and continuing self-improvement. Once hired, the document advises setting new goals and keeping skills and networking active in case of future opportunities.
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)The 2024 social media marketing trends report highlights significant shifts influenced by generative AI, including the emergence of personalized content, the rise of virtual influencers, and a stronger focus on user-generated content. Insights were gathered from 33 experts across 23 leading independent agencies, providing a perspective that emphasizes creativity and authenticity in marketing strategies. Key trends also include the blending of B2B and B2C approaches, reflecting changes in consumer behavior and the evolving landscape of social media engagement.
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine JournalThe document discusses trends in paid search for 2024, highlighting changes in user behavior, the implications for financial services, and privacy challenges. It emphasizes the importance of adapting search strategies, utilizing AI-driven tools like performance max and smart bidding, and leveraging first-party data for better marketing efficacy. Key takeaways include holistic SEO and SEM approaches, monitoring shifting user intents, and the need for continuous performance evaluation.
5 Public speaking tips from TED - Visualized summarySpeakerHubThe document outlines five public speaking tips from Chris Anderson, TED Talks curator, emphasizing the importance of eye contact, vulnerability, humor, humility, and storytelling. These skills are presented as essential for engaging audiences effectively and are increasingly valuable in today's economy. The article posits that mastering these techniques can enhance speakers' ability to communicate ideas powerfully.
ChatGPT and the Future of Work - Clark Boyd Clark BoydThe document provides an overview of generative AI, particularly focusing on ChatGPT and its implications for business and the job market. It discusses the rapid growth of generative AI, its applications in marketing, and the skills needed for the AI era while addressing potential job displacement and the need for adaptation. The agenda includes a Q&A session and emphasizes rethinking work in collaboration with AI technology.
Getting into the tech field. what next Tessa MeroThe document provides career advice for getting into the tech field, including:
- Doing projects and internships in college to build a portfolio.
- Learning about different roles and technologies through industry research.
- Contributing to open source projects to build experience and network.
- Developing a personal brand through a website and social media presence.
- Networking through events, communities, and finding a mentor.
- Practicing interviews through mock interviews and whiteboarding coding questions.
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray1. Core updates from Google periodically change how its algorithms assess and rank websites and pages. This can impact rankings through shifts in user intent, site quality issues being caught up to, world events influencing queries, and overhauls to search like the E-A-T framework.
2. There are many possible user intents beyond just transactional, navigational and informational. Identifying intent shifts is important during core updates. Sites may need to optimize for new intents through different content types and sections.
3. Responding effectively to core updates requires analyzing "before and after" data to understand changes, identifying new intents or page types, and ensuring content matches appropriate intents across video, images, knowledge graphs and more.
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACCThe document provides essential tips on how to handle difficult conversations in a workplace setting, emphasizing the importance of preparation, environment, and timing. It highlights that many employees dread such conversations, often leading to avoidance and worsening situations. Ultimately, the guide aims to promote positive outcomes while maintaining professional relationships.
3. Kas ir vienībtestēšana?
• Oficiāli:
– Metode, ko lieto atsevišķu programmatūras
koda daļu pārbaudei, vai tās darbojas
saskaņā ar specifikāciju.
– Testē mazāko iespējamo koda vienību
• klases metodi
• moduļa funkciju
• Vienkāršotā izpratnē
– Testi, ko raksta pats programmētājs
4. Galvenie mērķi
• Pārliecināties, ka
– kods dara to, kas paredzēts
– labojumi kodā (t.sk. refaktorēšana) nesabojā
kaut ko citu
• Uzlabot koda kvalitāti pirms integrācijas
testēšanas
• Padarīt kodu uzturamu arī citiem
• Automatizācija
5. Vienībtestēšana VS integrācijas
testēšana
• Vienībtesti nav integrācijas testi!
– Integrācijas testi apskata vairāku moduļu
sadarbību vai visu sistēmu kopumā
– Vienībtests pārbauda katru moduli atsevišķi
Vienībtests:
- vai šim vītnes
platums
visur ir vienāds?
http://www.bolt-manufacturer.com/picture/hex-bolts/heavy-hex-bolt.jpg
Integrācijas tests:
- vai ar šo var uzspiest līdz 45?
http://inhabitat.com/files/mowercycle23.jpg
6. Ko nozīmē "katru moduli
atsevišķi"?
• Vienībtestā jācenšas izolēt pārbaudāmo
moduli no citiem moduļiem
• Kļūdu gadījumā gribam zināt, kas tieši
vainīgs
• Lai izolētu no pārējiem moduļiem, lieto
imitācijas (mock) un aizbāžņus (stub)
saistīto moduļu vietā
7. xUnit
• xUnit: vienībtestēšanas ietvaru saime
dažādām valodām, kas
– izmanto programmatiskus testus
– lieto vienus un tos pašus jēdzienus
• Vēsturiski pirmais ir SUnit (SmallTalk unit
testing framework)
• Vēlāk arī JUnit (Java), CPPUnit (C++),
NUnit (.Net saimes valodas), PHPUnit.
8. xUnit termini
• Testu kopa (test suite)
– Atsevišķi testi, ko izpilda moduļa funkcionalitātes
pārbaudei
– Pārbaude kādam koda modulim (piemēram, klasei
DateTime būtu testu kopa DateTimeTest)
• Testpiemērs (test case)
– Tests, ko izpilda kādas funkcionalitātes pārbaudei
• Testa konteksts (test fixture)
– Datu/vides sagatavošana testu izpildīšanai
• Testu izpilde (test execution)
– Testu darbināšana dotajā kontekstā
• Apgalvojumi (assertions)
– Kodā pierakstāmi pieņēmumi, kam jābūt spēkā pirms/pēc
koda izpildes
• http://www.martinfowler.com/bliki/Xunit.html
9. xUnit testu kopas uzbūve
public class SomethingTest inerhits Test {
//sagatavošanās ('fixture')
public void SetUp() {
}
//savākšana aiz sevis
public void TearDown{
}
//paši testi
public void TestMethod1(){}
public void TestMethod2(){}
...
}
10. xUnit testu izpildes principi
• Meklē visas testu kopas
• Katrā testu kopā meklē visas metodes, kas
sākas ar "Test"
• Katrai šādai metodei izpilda:
SomethingTest->SetUp();
SomethingTest->TestMethod1();
SomethingTest->TearDown();
SomethingTest->SetUp();
SomethingTest->TestMethod2();
SomethingTest->TearDown();
11. Vienībtestēšanas maksimums
• Nopietnākais vienībtestēšanas lietojums –
testu bāzētā izstrāde (test driven
development)
– specificē moduļu interfeisus
– raksta testus, kas pārbauda šos interfeisus
– tikai tad sāk rakstīt pašu kodu
• Sākotnēji visi testi būs "izlaisti" vai "failed"
• Beigās būs strādājoša sistēma un 100%
veiksmīgi testi
15. PEAR: kas tas tāds?
• PEAR: PHP Extension and Application
Repository
• Ideja: komdandrindas rīks, kas ļautu instalēt
PHP paplašinājumus
• Uzlikšana:
1. iedarbina PHP komandrindas interfeisu
2. lejuplādē http://pear.php.net/go-pear.phar
3. php go-pear.phar
4. pārstartē tīmekļa serveri
• Var gadīties, ka noder
pear upgrade --force PEAR
16. Kas ir Xdebug?
• PHP ir skriptēšanas valoda, tas izpildās
kāda procesa ietvaros (tīmekļa serverī,
komandrindā)
– "klasiska" atkļūdošanas pieeja, kur pieslēdzas
procesam, būtu sarežģīta
• Xdebug ir PHP modulis, kas
– darbojas PHP interpretatora iekšienē
– uz ārpusi sniedz atkļūdošanas informāciju
– darbojas kā HTTP serviss
17. XDebug uzlikšana
• Xdebug ir PECL modulis
• Instalējams ar PEAR/PECL:
– pecl install xdebug
• Ini failā papildus:
[xdebug]
zend_extension=/Applications/XAMPP/xamppfiles/lib/php/php-
5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
18. PEAR uz XAMPP/Wamp
• XAMPP
– Jaunākās versijas ir ar PEAR,
– Xdebug jāinstalē pašiem
• WampSever
– Vecākās versijās PEAR var būt jāliek pašiem
– Xdebug vajadzētu būt
19. Xdebug atbalsts
• NetBeans – kopš 6.versijas integrēts
atbalsts
• Notepad++ var iekonfigurēt:
– http://dowdrake.com/showthread.php?343-
Xdebug-with-WAMPServer-and-Notepad
23. PHPUnit + ietvari?
• Zend
– Atbalsts jau iekļauts ietvarā
– http://framework.zend.com/wiki/display/ZFDEV/Testing+St
andards
• CodeIgniter
– Atbalsta ietvarā nav (ir slikts), ir 3. puses risinājums
– http://jensroland.com/projects/toast/
• (nav PHPUnit, bet esot labs)
– https://bitbucket.org/kenjis/my-ciunit/overview
– https://gist.github.com/1142213
• Symfony
– Ir spraudnis: http://www.symfony-
project.org/plugins/sfPhpunitPlugin
25. Failu struktūra
• Labā prakse ir katru (īstā) koda klasi likt
atsevišķā failā
• Katrai klasei "atbilst" ir sava testu kopa
• Tipisks risinājums: saknes katalogā veidot
apakškatalogu "tests" ar līdzīgu struktūru
īstajai
/
/common_includes /test
/database
/exporters /common_includes
/test /database
/exporters
26. Testa kopas struktūra
<?php
class ManaKlaseTest extends PHPUnit_Framework_TestCase {
protected $object; //testējamās klases instance
protected function setUp() {
$this->object = new ManaKlase();
}
protected function tearDown() {
unset($this->object);
}
public function testMetodesPasauksana() {
$this->object->PasauktMetodi();
$this->assert...();
}
27. Ko rakstīt testpiemēros
• Katrai metodei raksta vienu vai vairākus
testpiemērus
• Testpiemērs pasauc kādu funkciju un fiksē
apgalvojumus, kam jābūt spēkā pēc
izsaukšanas
• Labais stils – viens apgalvojums uz vienu
testpiemēru
28. Apgalvojumu veidi
• visi apgalvojumi ir
PHPUnit_Framework_TestCase metodes.
Tāpēc $this->assert..
• assertEquals(what1, what2);
• assertTrue(), assertFalse()
• assertGreaterThan(); assertLessThanOrEqual();
• assertStringStartsWith(); assertSelectRegexp();
• + daudz citu:
http://www.phpunit.de/manual/3.6/en/writing-tests-for-
phpunit.html#writing-tests-for-phpunit.assertions
29. Atkarības
• Var gadīties, ka nav jēgas pildīt testu
B, kamēr nav veiksmīgs tests A
• Tad testam B lieto atribūtu @depends
/**
* @depends testA
*/
public function testB(){
}
30. Datu piegādātāji
• Ir labi veikt testus ar dažādu ievaddatu
kopu
• Nav prātīgi visus ievaddatus "iešūt kodā"
• "Atpārošana" (decoupling) iespējama,
izmantojot @dataProvider atribūtu
• Piegādātājs = metode, kas atgriež testa
datu masīvu
• Piemēros parasti izmanto array(), praksē
varētu nolasīt no DB.
31. Datu piegādātāji – piemērs
class DataTest extends PHPUnit_Framework_TestCase
{
protected static $myData = array(
array(0, 0, 0),
array(0, 1, 1),
array(1, 0, 1),
array(1, 1, 3)
);
public static function provider()
{
return self::$myData;
}
/**
* @dataProvider provider
*/
public function testAdd($a, $b, $c)
{
$this->assertEquals($c, $a + $b);
}
}
32. Kas traucē vienībtestēšanai?
• Jebkas, kas padara testu specifisku
konkrētajam izpildes brīdim vai izsaukumam:
• Globālie mainīgie
– to uzstādīšana traucē veikt tīru testu
• "Singleton" pieeja
– Ir radniecīgi globālajiem mainīgajiem
• Biznesa darba veikšana konstruktorā
• Atkarība no datiem DB vai failu sistēmā
• Koda konstrukcijas:
– privātie & aizsargātie mainīgie