Inside the last of Germany’s disappearing nuclear plants

  • bernhard ludewig nuclear dream 4

     
     
  • bernhard ludewig nuclear dream 9

     
     
  • bernhard ludewig nuclear dream 10

     
     
  • bernhard ludewig nuclear dream 11

     
     
  • bernhard ludewig nuclear dream 12

     
     
  • bernhard ludewig nuclear dream 2

     
     
  • bernhard ludewig nuclear dream 3

     
     
  • bernhard ludewig nuclear dream 7

     
     
  • bernhard ludewig nuclear dream 6

     
     
  • bernhard ludewig nuclear dream 1

     
     
  • bernhard ludewig nuclear dream 5

     
     
  • bernhard ludewig nuclear dream cover

     
 
Written by Oscar Holland, CNN
After an earthquake and tsunami triggered multiple meltdowns at Japan’s Fukushima Daiichi power plant in 2011, the shockwaves were felt across the world’s nuclear industry. Over 5,000 miles away in Germany, where the use of atomic energy had long been a matter of contention, the incident sounded a death knell.
Chancellor Angela Merkel immediately announced that she was taking the country’s seven oldest nuclear power plants off the grid. Soon after, she pledged that the rest would be permanently shuttered by 2022, with the state’s focus shifting towards renewable alternatives.
So when photographer Bernhard Ludewig visited a nuclear plant for the first time in 2012, a year after Fukushima, he wasn’t simply glimpsing into an inaccessible world — he was documenting a closing chapter in German history.

Control rods pictured inside an open reactor at Emsland Nuclear Power Plant in northwestern Germany.

 
 
Control rods pictured inside an open reactor at Emsland Nuclear Power Plant in northwestern Germany. Credit: Bernhard Ludewig
“We picked a time when they were changing the fuel rods,” he recalled of this first encounter during a phone interview. “We spoke to the guy operating the loading machine and we were able to ride it right over the reactor, and I got my first picture. I’d seen some press photos, but it’s a different thing when you’re there. This was the start of the project.”
Ludewig went on to visit dozens of other sites in the following years. Through a combination of paperwork, persuasion and trust-building, he gained rare access to some of the country’s last remaining nuclear facilities, as well as capturing demolition already underway.
Inspired by Edward Burtynsky (the Canadian photographer known for his depictions of mines, oil refineries and other human interventions on natural landscapes), he decided to record a complete picture of the country’s atomic sector — not just power plants, but also research centers, training facilities and repositories for radioactive waste.

Inside the aluminum-paneled control room of the disused FR2 research reactor Karlsruhe.

 
 
Inside the aluminum-paneled control room of the disused FR2 research reactor Karlsruhe. Credit: Bernhard Ludewig
The resulting photos are, at times, mesmerizing. Ludewig’s focus on patterns and symmetry reveal the beauty hidden in complex centrifuges, retro-styled control rooms and soaring cooling towers that he described as possessing a religious, cathedral-like quality.
“Sometimes machinery or objects are like a person — I try to take portraits of them,” he said. “You take pictures and don’t think so much about what it is. You’ve got a feeling, and you follow it. And it gets more refined every time.”

Remaining neutral

Ludewig has now compiled around 300 of the photos into a new book, “The Nuclear Dream.” Set across more than 400 pages, it is an exhaustive survey of nuclear power, complete with diagrams, illustrations and contributor essays on physics and architecture.
The photographer also explored what he called “atomic age aesthetics” through vintage posters and paraphernalia purporting the benefits of the then-new technology. This early utopian imagery, inspired by movements like modernism and the Bauhaus school, offers a stark juxtaposition with images of today’s often faded facilities.

Inside an exploratory mine drilled beneath the town of Gorleben, where radioactive waste may be permanently stored.

 
 
Inside an exploratory mine drilled beneath the town of Gorleben, where radioactive waste may be permanently stored. Credit: Bernhard Ludewig
Yet Ludewig maintains that he is neither for nor against nuclear power, but rather a “neutral” intrigued by technology that once carried promises of the future. His aim, he said, was to capture this disappearing world for posterity’s sake, rather than to promote or critique the country’s energy policy.
“It was truly documenting,” added Ludewig, who said disagreements over nuclear power are like a “civil war” in Germany. “You have two camps. It’s like Trump’s America, you’re either a Republican or a left-wing liberal and they don’t talk to each other. Anybody who says anything is regarded as being for us or against us.”
 
 
While Fukushima served as a catalyst for widespread public opposition in Germany, the country’s commitment to phasing out nuclear plants dates back 20 years. Debates over the perceived dangers and deficiencies of atomic energy are older still.
During the 1970s, left-wing protests outside nuclear facilities in former West Germany were common, and often resulted in violent clashes with police. Proposals to dispose of radioactive waste in salt mines in Gorleben have made the small town a flashpoint for demonstrations ever since. (Ludewig’s book include photos of an exploratory mine drilled beneath Gorleben as part of Germany’s ongoing search for a permanent answer to its nuclear waste problem).

Ludewig's project also took him to the abandoned Chernobyl Nuclear Power Plant in present-day Ukraine.

 
 
Ludewig’s project also took him to the abandoned Chernobyl Nuclear Power Plant in present-day Ukraine. Credit: Bernhard Ludewig
For Ludewig, however, the real “turning point” was Chernobyl. The 1986 disaster — which sent radioactive fallout across Europe, caused a spike in cancer rates and left a 1,000-square-mile area of present-day Ukraine largely uninhabitable — fundamentally changed the debate in Germany. Soviet-designed facilities in the country’s east, such as the Greifswald Nuclear Power Plant, were decommissioned after the country’s reunification. And no new nuclear power facilities were built in Germany from the 1990s onwards.
So as well as visiting sites in Finland and Brazil, Ludewig also made a pilgrimage to the Chernobyl Exclusion Zone in order to paint a more complete picture of the industry. The photos he returned with, including eerie images of the doomed plant’s long-abandoned control room, help provide objectivity and balance to the project, he said.
“If you publish hundreds of pictures about nuclear power that show its hidden beauty, and you don’t show the catastrophe, then it wouldn’t be honest.”
 
taken from here

How will we party post-pandemic?

In nightclubs around the world, once-crowded dance floors have remained empty for months. If you need reminding, clubbing is close contact activity: People share drinks, hug, kiss and generally invade each others personal space until the early hours of the morning.
And while such escapism and a chance to blow off some steam might be welcome after extended worldwide lockdowns due to the coronavirus pandemic, the current situation spells trouble for nightlife. How can people safely hit the dance floor while respecting new social distancing measures?
Some early attempts to reopen clubs and live music venues have provided clues to what the future of nightlife might hold. In China, where nightclubs have reopened, attendees undergo temperature checks before entering and register their personal information to make contact tracing easier. Venues are offering extra precautions such as disposable cups and hourly bathroom disinfecting.

In Shanghai, nightlife staff wear masks and keep bars and clubs disinfected for patrons.

 
 
In Shanghai, nightlife staff wear masks and keep bars and clubs disinfected for patrons. Credit: Hector Retamal/AFP/Getty Images
“The fear is the challenge,” said Shane Davis, co-founder and creative director of Brooklyn venue Public Records, over video chat. “It’s the fear of the unknown, the fear of being among people that you don’t necessarily trust.”
In South Korea, a cluster of new cases linked to nightclubs forced all of the Seoul’s bars and clubs to temporarily close just weeks after strict social distancing measures were eased. Just last weekend, people gathered to dance at an open-air venue in Münster, Germany — possibly the first sanctioned electronic party in Europe since the wave of infections forced venues to shutter.

Resident Advisor

@residentadvisor

 

In what might be the first dance party in Europe in months, Gerd Janson played to a small, socially-distanced crowd in Münster last night. We’re speaking with the promoters on how they pulled this one off. More details forthcoming

Embedded video

789 people are talking about this
 
 
For decades, nightclubs and raves have provided a sense of community in times of social or political upheaval, one that has often thrived under limitations and restraints.
In the 1970s, New York City discos offered a safe haven for LGBTQ visibility; in 1988, rebellious and hedonistic acid house parties swept the UK and birthed an entirely new music movement; in the 1990s, German techno thrived after the fall of the Berlin Wall, unifying the country’s once-separated youth.
While many venues will struggle to stay afloat without filling to capacity each weekend, it looks as though design, technology and some creative ingenuity can help reshape how people return to nightclubs, even if no touching is allowed. Here are some ways the party might go on in 2020 and beyond.

A new wave of subculture style

One LA-based studio has imagined protective gear that looks like it’s straight out of “Tron.” The Micrashell concept is an upper-body suit and helmet with N95 particle filtration that can be worn over one’s clothes. To keep the design airtight and — in theory — virus-free, wearers drink from alcohol canisters built into the suit and communicate through built-in speakers. Production Club, which also designs world tours for DJs and electronic artists, is currently prototyping the concept and seeking funding, hoping to offer them in bulk to venues that can only operate at limited capacity.

 
 
“What we designed was not going to be a piece of medical equipment,” creative director Miguel Risueño said. “Because then it’s a downer rather than something that makes you happy.” Credit: Production Club, Inc.
“We decided we needed to find a solution to bring events back — not in one year but tomorrow,” said creative director Miguel Risueño. “We came up with this idea of creating a suit that allows you to socialize.” Recognizing the history of club culture and costume, Risueño and his team opted for a neon-enhanced futuristic design.
“What we designed was not going to be a piece of medical equipment,” he said. “Because then it’s a downer rather than something that makes you happy.”
Personal protective equipment (PPE) may begin as a necessity — newly opened clubs are requiring or strongly encouraging masks — but plain surgical masks and disposable gloves are unlikely to stay the norm for very long. Club fashion has often embraced style trends that serve a purpose, from hand fans to keep you cool while dancing, to handkerchiefs offering a coded system for sexual identity and liaisons.

Production Club hopes to throw their first party with the Micrashell by the end of the year.

 
 
Production Club hopes to throw their first party with the Micrashell by the end of the year. Credit: Production Club, Inc.
Masks, in particular, already have a history in the club scene and particular subcultures within it — cyber goths tap into sci-fi themes with PVC or gas masks, and kandi ravers string together colorful beaded masks. At festivals, attendees often wear bandanas to shield themselves from the elements. Clothing can provide other precautionary barriers, too. Larger-than-life avant-garde silhouettes featured prominently among New York club kids in the ’90s, and could be playfully revisited to keep others at a distance.
Even if full rave suits don’t catch on, wearable tech may rise to the challenge. Already, Brooklyn-based tech company StrongArm Tech has created a mobile-phone sized device that can warn someone if another person is closer than six feet away, and capture information required for contact tracing. Though it has been touted as a way for people to return to work safely, similar devices could be used in bars and clubs.

Dancing in the open air

Open-air venues are more likely to thrive after the pandemic wanes. At the recent event in Münster, event staff at Coconut Beach added another layer of social distancing through circles on the floor spread six feet apart. That tactic was seen again in a recent TikTok video from Slovakia, where party-goers gathered beneath an underpass to dance in cordoned-off squares.
As Spain eases its lockdown, the country will allow indoor venues to operate with a maximum of only 80 people — an unsustainable capacity for spaces that often fit hundreds or thousands of patrons — while up to 800 people will be allowed at outdoor venues. Ticket prices could increase as a result. In the case of the Coconut Beach party, which only offered entry to 100 people, tickets cost at 70 euros ($77 USD) each.
Limited entry could push more dance events into the underground, which carries greater risks. Unsanctioned raves in the woods or open fields, of the type that swept the UK in the 1980s and 1990s, and still crop up today, could see a resurgence as a response to new restrictions or shuttered clubs. In Leeds, UK, three people were arrested this week for attending a 200-person party on a protected nature reserve.

Drive-in events have expanded beyond movies to live music and theater. Here, 200 cars line up to see German DJ Alle Farben perform in Bonn, Germany.

 
 
Drive-in events have expanded beyond movies to live music and theater. Here, 200 cars line up to see German DJ Alle Farben perform in Bonn, Germany. Credit: Andreas Rentz/Getty Images
Meanwhile, in Schüttorf, Germany, promoters looked to cinema for a new — and safer — type of dance party, throwing a drive-in rave that kept everyone isolated in their cars.
Motorists also pulled into a field in Bonn where DJ Frans Zimmer, aka Alle Farben, performed at “BonnLive Autokonzerte,” a series of car concerts inspired by the need for social distancing.

Virtual streams and listening rooms

Worldwide, clubs have kept people dancing in the privacy of one’s home, by taking their programming virtual. In New York, with over 25,000 restaurants and nightlife venues disrupted by the virus, Brooklyn clubs have hosted dance parties over Zoom or built their own websites for live streams. They include Public Records’ online endeavor, Public Access, which Davis calls a “24-hour music television channel,” that has featured an eclectic mix of audio and visuals.
Until people can freely return to dancing indoors, clubs will need to figure out how to adjust to social distancing measures. “The dance floor will adapt,” Davis said. “It might not be the same dance floor with people (wearing) masks, but maybe a different experience altogether.”
That could include more “listening experiences,” he said, instead of traditional dance parties — more akin to the sound cafes and smaller venues popular in Tokyo, which proliferated due to the country’s decades-long ban on dancing after midnight. In Berlin, nightlife is seeing drastic changes as venues attempt to safely welcome patrons — clubs that typically stay open for upwards of 60 hours at a time, such as the sprawling indoor-outdoor venue Sisyphos, are tenuously opening as beer gardens with live music, with dancing not yet allowed.

Berlin nightclub Kater Blau participates in

 
 
Berlin nightclub Kater Blau participates in “United We Stream,” an effort in March by the city’s musicians, promoters and clubs to keep live music going during lockdown. Credit: John MacDougall/AFP/Getty Images
New York City is still, at minimum, more than a month away from seeing the reopening of music venues, but will face the same challenges of other international venues trying to operate under new city laws. What Davis doesn’t want is to sacrifice the spirit of Public Records — which could be hampered by highly monitored, limited-capacity events.
“The beauty of nightlife…is that element of chance,” of being around others who “are unfamiliar and exciting,” Davis said. “If we’re not able to achieve that level of experience, then we’re just gonna do something completely different until we can again.”
 
source: here

Četvrta industrijska revolucija: Šta to znači i kako da se postavimo?

Stojimo na ivici tehnološke revolucije koja će u temelju izmeniti način na koji živimo, radimo i na koji smo povezani jedni sa drugima. Po svom nivou, obimu i složenosti, ova transformacija neće biti slična nijednoj promeni koju je ljudska rasa već iskusila.

Još uvek ne znamo kako će se odvijati, ali jedna stvar je jasna – odgovor na to mora biti integrisan i sveobuhvatan, uključujući sve aktere globalne vladavine, od javnih i privatnih sektora do akademskih i građanskih zajednica.

Industrijske revolucije kroz istoriju

Prva industrijska revolucija je koristila vodu i moć pare kako bi mehanizovala proizvodnju. Druga je koristila električnu moć kako bi kreirala masovnu proizvodnju. Treća je koristila elektroniku i informacionu tehnologiju kako bi automatizovala proizvodnju.

Danas je Četvrta industrijska revolucija izgrađena na Trećoj, digitalnoj revoluciji koja se pojavila od sredine prošlog veka. Karakteriše je spajanje tehnologija što dovodi do brisanja granica između fizičke, digitalne i biološke sfere.

Postoje tri razloga zašto današnje transformacije predstavljaju ne samo produženje Treće industrijske revolucije nego i dolazak Četvrte:

  1. brzina
  2. obim
  3. uticaj na sisteme

Brzina trenutnih prodora nema istorijski presedan. Kada se uporedi sa prethodnim industrijskim revolucijama, Četvrta se razvija eksponencijalnim, a ne linearnim tempom.

industrija

Kako prepoznajemo Četvrtu industrijsku revoluciju?

Četvrta industrijska revolucija remeti skoro svaku industriju u svakoj zemlji. Širina i dubina ovih promena su vesnici transformacije svih sistema proizvodnje, menadžmenta i vlada.

Više od milijarde ljudi su povezani mobilnim uređajima, jedinstvenom procesorskom snagom, kapacitetom skladišta i pristupom znanju, a njihove mogućnosti su neograničene.

Ove mogućnosti će biti umnožene tehnološkim inovacijama u nastajanju u oblastima kao što su:

  • veštačka inteligencija,
  • robotika,
  • autonomna vozila,
  • 3D štampanje,
  • nanotehnologija,
  • biotehnologija,
  • nauka o materijalima,
  • skladištenje energije,
  • kvantno računanje.

Već sada je veštačka inteligencija svuda oko nas, od samoupravljajućih automobila i bespilotnih letelica do virtuelnih asistenata i programa koji prevode ili investiraju.

Prethodnih godina u oblasti veštačke inteligencije je napravljen impresivan napredak, vođen eksponencijalnim rastom računarske snage i dostupnošću ogromne količine podataka, od programa korišćenih da otkriju nove lekove do algoritama koji se koriste da bi predvideli kulturne interese.

U međuvremenu, digitalne tehnologije u proizvodnji su svakodnevno u interakciji sa biološkim svetom. Inženjeri, dizajneri i arhitekte kombinuju kompjuterski dizajn, inženjering materijala i sintetičku biologiju koja razvija simbiozu između mikroorganizama, naših tela, proizvoda koji konzumiramo, pa čak i zgrada koje nastanjujemo.

displaj budućnosti

Lepe i ružne strane Četvrte industrijske revolucije

Kao i revolucije koje su joj prethodile, Četvrta industrijska revolucija ima potencijal da poveća globalni nivo prihoda i poboljša kvalitet života populaciji širom sveta.

Do sada, oni koji su najviše imali koristi od nje su potrošači koji su bili u mogućnosti da je sebi priušte i da pristupe digitalnom svetu. Tehnologije su omogućile novim proizvodima i uslugama da povećaju efikasnost i zadovoljstvo u našim životima.

Naručivanje taksija, zakazivanje leta, kupovina proizvoda, online plaćanje, slušanje muzike, gledanje filma ili igranje video igre – sve ovo sada može da se radi na daljinu.

U budućnosti, tehnološke inovacije će nam doneti dugoročne dobiti u efikasnosti i produktivnosti. Tako će se troškovi prevoza, komunikacije i razmene smanjiti,a  logistika i lanci globalnog snabdevanja će postati efektivniji. Sve to će otvoriti nova tržišta i dovesti do ekonomskog rasta.

Istovremeno bi nova revolucija mogla doneti veću nejednakost, naročito zbog njenog potencijala da remeti tržište rada.

S obzirom na to da automatizacija zamenjuje rad, deo radnika bi morao da se otpusti ili premesti, što bi moglo pogoršati raskorak između prinosa kapitala i prinosa od rada.

vreme je novac

U drugu ruku, moguće je da će zamena radnika tehnologijom zbirno rezultirati porastom sigurnih i korisnih poslova.

U ovom trenutku ne možemo predvideti koji scenario će se odigrati, ali istorija nam govori da će ishod verovatno biti neka kombinacija ova dva primera.

U budućnosti će talenat, više nego kapital, predstavljati kritični faktor proizvodnje. Zbog ovoga će se na tržištu zabeležiti podela na niže kvalifikovane radnike, koji će biti slabo plaćeni, i u visoko kvalifikovane radnike, koji će imati dobre plate. Sve ovo će voditi do porasta društvenih tenzija.

Pored toga što je ključno ekonomsko pitanje, nejednakost predstavlja najveći društveni problem koji je povezan sa Četvrtom industrijskom revolucijom.

Najveći korisnici inovacija imaju tendenciju da budu davaoci intelektualnog i fizičkog kapitala – inovatori, akcionari, investitori. Doći će do porasta bogatstva, dok će istovremeno porasti i siromaštvo.

Tehnologija je jedan od glavnih razloga zašto su prihodi stagnirali ili opali za veći deo populacije u zemljama sa visokim prihodima. Potražnja za radnicima sa višim obrazovanjem se povećala, dok je potražnja za radnicima sa nižom edukacijom i nižim kvalifikacijama opala.

Sve ovo nam objašnjava zašto su radnici razočarani i zašto se plaše će njihovi prihodi i prihodi njihove dece nastaviti da stagniraju. Ovo takođe objašnjava zašto srednja klasa širom sveta oseća nezadovoljstvo i nepravdu.

Ekonomija sa motoom pobednik uzima sve nudi samo ograničen pristup srednjoj klasi i predstavlja recept slabe demokratije.

Nezadovoljstvo takođe može biti uzorokovano ukorenjenošću digitalnih tehnologija i dinamikom razmene informacija koje je tipično za društvene medije.

Više od 30% globalne populacije sada koristi platforme društvenih mreža da bi se povezali, učili, delili informacije. U idealnom svetu, ove interakcije bi obezbedile priliku za međukulturološko razumevanje i koheziju.

Međutim, oni takođe mogu stvoriti i širiti nerealna očekivanja o tome šta predstavlja uspeh za pojedinca ili grupu, kao i da nude prilike za širenje ekstremnih ideja i ideologija.

Uticaj na posao

Ubrzanje inovacija i njihovih promena je teško shvatiti i predvideti. Nove tehnologije predstavljaju izvor stalnog iznenađenja, čak i za one dobro informisane.

Zaista, u svim industrijama postoji jasan dokaz da tehnologije koje podupiru Četvrtu industrijsku revoluciju imaju snažan uticaj na posao.

Mnoge industrije vide uvod u nove tehnologije kao stvaranje novih načina ispunjavanja postojećih potreba, što značajno remeti vrednost postojećih lanaca industrije.

Promene počinju od agilnih, inovativnih konkurenata koji zahvaljujući pristupima globalnim digitalnim platformama za istraživanje, razvoj, marketing, prodaju i distribuciju mogu svrgnuti dobro uspostavljene izvršioce brže nego ikada, poboljšavajući kvalitet, brzinu ili cenu po kojoj je vrednost isporučena.

Glavne promene na strani potražnje događaju se kao:

  • rastuća transparentnost,
  • angažovanje potrošača.
  • novi obrasci ponašanja potrošača (zbog pristupa mobilnim mrežama i podacima).

Sve ovo tera kompanije da se prilagode tome i da menjaju način na koji dizajniraju i isporučuju proizvode i usluge.

Ključni trend je razvoj platformi koje kombinuju ponudu i tražnju, koje se lako koriste na smartfonima i stvaraju potpuno nove načine konzumiranja dobara i usluga. One smanjuju barijere za kompanije i stvaraju im bogatstvo.

Ove nove platforme se konstantno transformišu u mnoge nove usluge, stvarajući nove biznise ili unapređujući postojeće.

Uopšteno gledajući, postoje četiri glavna efekta koje industrijska revolucija ima na poslovanje:

  1. očekivanja kupaca,
  2. unapređenje proizvoda,
  3. inovativna saradnja,
  4. organizacione forme.

Sada su potrošači u epicentru ekonomije i sve se vrti oko poboljšanja načina na koji će oni biti usluženi.

Više nego ikada, fizički proizvodi i usluge mogu biti poboljšani sa digitalnim mogućnostima koje povećavaju njihovu vrednost. Nove tehnologije čine sredstva trajnijim i otpornijim, a kompanije dobijaju povratne informacije putem analiza i podataka.

Svet potrošačkih iskustava, usluga baziranih na podacima i performansama sredstava zahteva nove forme saradnje, posebno imajući u vidu brzinu kojom inovacije uzimaju danak.

Pojava novih platformi i drugih novih poslovnih modela znači da nove forme moraju biti ponovo osmišljene.

Sve u svemu, neumoljive promene od jednostavnih organizacija (Treća industrijska revolucija) do inovacija baziranih na kombinacijama tehnologija (Četvrta industrijska revolucija) je prisiljavanje kompanija da preispitaju način na koji posluju.

Poslovni lideri i zaposleni bi trebalo da razumeju promenljivo okruženje, da budu u toku zajedno sa svojim operativnim timovima i da nemilosrdno i stalno prate inovacije.

Uticaj na vlade

Nove tehnologije i platforme će sve više omogućavati građanima da se angažuju u rad vlada, iznesu svoje mišljenje i, čak, nadmudre nadzor javnih vlasti.

Istovremeno, vlade će usvojiti moći novih tehnologija kako bi povećali kontrolu nad populacijom, bazirano na prožimajućim sistemima nadzora i mogućnostima da kontrolišu digitalnu infrastrukturu.

U celini, vlade će se sve više suočiti sa pritiskom da izmene trenutni pristup javnog angažovanja i kreiranja politike, baš kao što se njihova centralna uloga vođenja politike smanjuje zbog novih izvora konkurencije, preraspodele i decentralizacije moći koje nove tehnologije omogućavaju.

politika

Na kraju, prilagodljivost vladajućih sistema i javnih vlasti će odrediti njihovo preživljavanje. Ukoliko dokažu da su sposobni da se suoče da svetom stalnih promena, to će im omogućiti da održe svoju konkurentsku prednost. Ukoliko ne budu mogli da evoluiraju, biće suočeni sa sve većim problemima.

Ovo će biti naročito vidljivo u oblasti propisa. Trenutni sistemi javne politike i donošenja odluka su evoluirali uz Drugu industrijsku revoluciju kada su donosioci odluka imali vremena da proučavaju specifična pitanja i razvijaju neophodne odgovore i odgovarajući regulativni okvir.

Takav pristup više nije izvodljiv.

S obzirom na to da Četvrta industrijska revolucija ima brz tempo promena, zakonodavci sve više dokazuju da su nesposobni da se sa njima izbore.

Kako bi onda oni mogli da održe interese potrošača i javnosti, a da istovremeno podržavaju inovacije i tehnološki razvoj?

To bi mogli da postignu prihvatanjem agilnog upravljanja, baš kao što privatni sektor sve više usvaja agilne odgovore o softverskom razvoju i poslovanju uopšte.

Ovo znači da se propisi moraju stalno prilagođavati novom, brzo promenljivom okruženju. Važno je da zaista razumeju šta je to što regulišu. Kako bi to uradili, vlade i regulatorne agencije bi trebalo da sarađuju blisko za kompanijama i građanskim društvima.

Četvrta industrijska revolucija će takođe duboko uticati na prirodu nacionalne i internacionalne bezbednosti, kao i na verovatnoću i prirodu sukoba. Istorija oružanih sukoba i internacionalne bezbednosti je istorija tehnološke inovacije, pa to ni danas nije izuzetak.

Kako se ovaj proces odvija, nove tehnologije kao što su autonomna ili biološka oružja, postaju lakša za korišćenje, pa će se individualci i male grupe sve više pridruživati državama kako bi nanosili masovnu štetu.

Ova nova ranjivost će voditi novim strahovima, ali će istovremeno napredak u tehnologiji stvarati potencijal da se reducira stepen uticaja nasilja kroz razvoj novih vidova zaštite (na primer, veće preciznosti u ciljanju u vojnoj industriji).

Uticaj na ljude

Četvrta industrijska revolucija će menjati ne samo ono što radimo nego i ono što smo. Uticaće na naš identitet i na:tehnologija

  • naš osećaj za privatnost,
  • naš pojam vlasništva,
  • naše obrasce potrošnje,
  • vreme koje posvetimo poslu,
  • naše slobodno vreme,
  • to kako razvijamo karijeru
  • to kako gajimo naše veštine,
  • to kako upoznajemo ljude,
  • to kako negujemo veze,
  • promenu našeg zdravlja.

Ova lista je beskrajna.

Tehnologije će uticati i na našu saradnju i empatiju. Naša veza sa smartfonima je poseban slučaj za posmatranje. To što smo stalno online i dostupni može nas lišiti životno najvažnijih stvari: vremena za pauzu, razmišljanje i učestvovanje u svrsishodnim razgovorima.

Jedan od najvećih individualnih izazova novog doba je privatnost. Praćenje i deljenje informacija o našim životima bitan je deo novog načina povezivanja sa ljudima.

Debate o problemima kao što su uticaj na naše unutrašnje živote i nedostatak kontrole naših podataka samo će se intenzivirati u godinama koje dolaze.

Revolucije koje se dešavaju u biotehnologiji i veštačkoj inteligenciji ponovo definišu šta to znači biti ljudsko biće menjanjem trenutnih granica životnog veka, zdravlja, razuma i sposobnosti. Revolucije nas primoravaju da ponovo definišemo etičke i moralne granice.

Oblikovanje budućnosti

Ni tehnologija niti poremećaji koji dolaze sa njom nisu spoljašnja snaga nad kojom ljudi ne mogu da imaju kontrolu. Svi mi smo odgovorni u odlukama koje svakodnevno donosimo kao građani, potrošači i investitori.

Na ovaj način bi trebalo da shvatimo priliku i moć koju imamo nad oblikovanjem Četvrte industrijske revolucije i da je usmerimo prema budućnosti koja odražava naše zajedničke ciljeve i vrednosti.

Kako bismo ovo uradili trebalo bi da razvijemo obimno i globalno deljeno gledište o tome kako tehnologija utiče na naše živote i preoblikuje našu ekonomiju, društvo, kulturu i okruženje. Moramo razmišljati strategijski o snagama poremećaja i inovacija koje će oblikovati našu budućnost.

Kada sve ovo uzmemo u obzir, na kraju se sve svodi na ljude i na vrednosti. Potrebno je da oblikujemo budućnost koja je dobra za sve nas tako što ćemo stavljati ljude na prvo mesto i osnaživati ih.

U njenoj najpesimističnijoj, nehumanoj formi, Četvrta industrijska revolucija bi mogla zaista imati potencijal da robotizuje čovečanstvo i da nam oduzme ono što je za čoveka suštinko. Ali suprotno gledano, kao dopuna najboljim delovima ljudske prirode (kreativnost, empatija), takođe može da podigne čovečanstvo na nov nivo kolektivne i moralne svesti zasnovane na zajedničkom smislu sudbine.

Obaveza svih nas je da se potrudimo da ovo poslednje prevlada.

Izvor

Web Application Testing Guide

Web Application Testing Complete Guide (How To Test A Website)

A Complete Web Application Testing Guide: How To Test A Website

We all have to agree that in today’s ever-changing and competitive world, the internet has become an integral part of our lives.

Most of us make our decisions by searching the information on the internet these days, hence hosting a website is no longer optional but mandatory for all kind of businesses. It is the first step in becoming and staying relevant in the market. 

Just having a website is not enough. An organization is needed to develop a website that is informative, accessible and user-friendly. To maintain all these qualities, the website should be well tested, and this process of testing a website is known as web testing.

 

What Is Web Testing?

Web testing is a software testing practice to test websites or web applications for potential bugs. It’s a complete testing of web-based applications before making live.

A web-based system needs to be checked completely from end-to-end before it goes live for end users.

By performing website testing, an organization can make sure that the web-based system is functioning properly and can be accepted by real-time users.

The UI design and functionality are the captains of website testing.

Web Testing Checklists

1) Functionality Testing
2) Usability testing
3) Interface testing
4) Compatibility testing
5) Performance testing
6) Security testing


Recommended tools for practicing web testing concepts mentioned in this page:

#1) CrossBrowserTesting

CrossBrowserTesting allows you to make every web experience perfect, on any browser or mobile device with their cloud-based real device lab. Ditch your VMs and device lab. Easily run manual, visual, and Selenium tests in the cloud on 2050+ real desktop and mobile browsers.

=> Visit CrossBrowserTesting Website


#2) LoadNinja

LoadNinja lets you load test your web application with real browsers at scale, using test scripts that can be replayed immediately after recording, producing actionable browser-based performance data to isolate issues and debug errors in real-time.

=> Visit LoadNinja Website


#1) Functionality Testing

Test for – all the links in web pages, database connection, forms used for submitting or getting information from the user in the web pages, Cookie testing, etc.

Check all the links:

  • Test the outgoing links from all the pages to the specific domain under test.
  • Test all internal links.
  • Test links jumping on the same pages.
  • Test links used to send email to admin or other users from web pages.
  • Test to check if there are any orphan pages.
  • Finally, link checking includes, check for broken links in all the above-mentioned links.

Test forms on all pages:
Forms are an integral part of any website. Forms are used for receiving information from users and to interact with them. So what should be checked in these forms?

  • First, check all the validations on each field.
  • Check for default values of the fields.
  • Wrong inputs in the forms to the fields in the forms.
  • Options to create forms if any, form delete, view or modify the forms.

Let’s take an example of the search engine project currently I am working on, in this project we have advertiser and affiliate signup steps. Each sign-up step is different but it’s dependent on the other steps.

So sign up flow should get executed correctly. There are different field validations like email Ids, User financial info validations, etc. All these validations should get checked in manual or automated web testing.

Cookies Testing:

Cookies are small files stored on the user machine. These are basically used to maintain the session- mainly the login sessions. Test the application by enabling or disabling the cookies in your browser options.

Test if the cookies are encrypted before writing to the user machine. If you are testing the session cookies (i.e. cookies that expire after the session ends) check for login sessions and user stats after the session ends. Check the effect on application security by deleting the cookies. (I will soon write a separate article on cookie testing as well)

Validate your HTML/CSS:

If you are optimizing your site for Search engines then HTML/CSS validation is the most important one. Mainly validate the site for HTML syntax errors. Check if the site is crawlable to different search engines.

Database Testing:

Data consistency is also very important in a web application. Check for data integrity and errors while you edit, delete, modify the forms or do any DB related functionality.

Check if all the database queries are executing correctly, data is retrieved and also updated correctly. More on database testing could be a load on DB, we will address this in web load or performance testing below.

In testing the functionality of the websites the following should be tested:

Links
i. Internal Links
ii. External Links
iii. Mail Links
iv. Broken Links

Forms
i. Field validation
ii. Error message for wrong input
iii. Optional and Mandatory fields

Database
Testing will be done on database integrity.

#2) Usability Testing

Usability testing is the process by which the human-computer interaction characteristics of a system are measured, and weaknesses are identified for correction.

• Ease of learning
• Navigation
• Subjective user satisfaction
• General appearance

Test for Navigation:

Navigation means how a user surfs the web pages, different controls like buttons, boxes or how the user uses the links on the pages to surf different pages.

Usability Testing includes the following:

  • The website should be easy to use.
  • The instructions provided should be very clear.
  • Check if the instructions provided are perfect to satisfy its purpose.
  • The main menu should be provided on each page.
  • It should be consistent enough.

Content Checking:

Content should be logical and easy to understand. Check for spelling errors. The usage of dark colors annoys the users and should not be used in the site theme.

You can follow some standard colors that are used for web pages and content building. These are the commonly accepted standards like what I mentioned above about annoying colors, fonts, frames, etc.

Content should be meaningful. All the anchor text links should be working properly. Images should be placed properly with proper sizes.

These are some of the basic important standards that should be followed in web development. Your task is to validate all for UI testing.

Other user information for user help:

Like the search option, the sitemap also helps files, etc. The sitemap should be present with all the links on websites with a proper tree view of navigation. Check for all links on the sitemap.

“Search in the site” option will help users to find content pages that they are looking for easily and quickly. These are all optional items and if present they should be validated.

#3) Interface Testing

In web testing, the server-side interface should be tested. This is done by verifying that communication is done properly. Compatibility of the server with software, hardware, network, and the database should be tested.

The main interfaces are:

  • Web server and application server interface
  • Application server and Database server interface.

Check if all the interactions between these servers are executed and errors are handled properly. If the database or web server returns an error message for any query by application server then the application server should catch and display these error messages appropriately to the users.

Check what happens if the user interrupts any transaction in-between? Check what happens if the connection to the webserver is reset in between?

#4) Compatibility Testing

The compatibility of your website is a very important testing aspect. See which compatibility test to be executed:

  • Browser compatibility
  • Operating system compatibility
  • Mobile browsing
  • Printing options

Browser Compatibility:

In my web-testing career, I have experienced this as the most influencing part of website testing.
Some applications are very dependent on browsers. Different browsers have different configurations and settings that your web page should be compatible with.

Your website coding should be a cross-browser platform compatible. If you are using java scripts or AJAX calls for UI functionality, performing security checks or validations then give more stress on browser compatibility testing of your web application.

Test web application on different browsers like Internet Explorer, Firefox, Netscape Navigator, AOL, Safari, Opera browsers with different versions.

OS Compatibility:

Some functionality in your web application is that it may not be compatible with all operating systems. All new technologies used in web development like graphic designs, interface calls like different API’s may not be available in all Operating Systems.

Hence test your web application on different operating systems like Windows, Unix, MAC, Linux, Solaris with different OS flavors.

Mobile Browsing:

We are in the new technology era. So in future Mobile browsing will rock. Test your web pages on mobile browsers. Compatibility issues may be there on mobile devices as well.

Printing Options:

If you are giving page-printing options then make sure fonts, page alignment, page graphics, etc., are getting printed properly. Pages should fit the paper size or as per the size mentioned in the printing option.

#5) Performance Testing

The web application should sustain to heavy load. Web performance testing should include:

  • Web Load Testing
  • Web Stress Testing

Test application performance on different internet connection speeds.

Web Load Testing: You need to test if many users are accessing or requesting the same page. Can the system sustain in peak load times? The site should handle many simultaneous user requests, large input data from users, simultaneous connection to DB, heavy load on specific pages, etc.

Web Stress Testing: Generally stress means stretching the system beyond its specified limits. Web stress testing is performed to break the site by giving stress and it’s checked as to how the system reacts to stress and how it recovers from crashes. Stress is generally given on input fields, login and sign up areas.

In web performance, testing website functionality on different operating systems and different hardware platforms is checked for software and hardware memory leakage errors.

Performance testing can be applied to understand the web site’s scalability or to benchmark the performance in the environment of third-party products such as servers and middleware for potential purchase.

Connection Speed
Tested on various networks like Dial-Up, ISDN, etc.

Load
i. What is the no. of users per time?
ii. Check for peak loads and how the system behaves
iii. A large amount of data accessed by the user

Stress
i. Continuous Load
ii. Performance of memory, CPU, file handling, etc..

#6) Security Testing

Following are some of the test cases for web security testing:

  • Test by pasting the internal URL directly into the browser address bar without login. Internal pages should not open.
  • If you are logged in using username and password and browsing internal pages then try changing URL options directly. I.e. If you are checking some publisher site statistics with publisher site ID= 123. Try directly changing the URL site ID parameter to different site ID which is not related to the logged-in user. Access should be denied for this user to view other’s stats.
  • Try some invalid inputs in input fields like login username, password, input text boxes, etc. Check the system’s reaction to all invalid inputs.
  • Web directories or files should not be accessible directly unless they are given download option.
  • Test the CAPTCHA for automating script logins.
  • Test if SSL is used for security measures. If it is used, the proper message should get displayed when users switch from non-secure HTTP:// pages to secure HTTPS:// pages and vice versa.
  • All transactions, error messages, security breach attempts should get logged in log files somewhere on the webserver.

The primary reason for testing the security of a web is to identify potential vulnerabilities and subsequently repair them.

  • Network Scanning
  • Vulnerability Scanning
  • Password Cracking
  • Log Review
  • Integrity Checkers
  • Virus Detection

Types Of Web Testing

A website is classified into many types, it is about 20 types. All these are shrinking under static and dynamic type. Among them let’s discuss 4 types and its testing methods in a detailed manner. Before that, I just want to bullet those types.

  • Simple static website testing
  • Dynamic web application testing
  • E-commerce website testing
  • Mobile website testing

#1) Simple Static Website

A simple static website will display the same content for all visitors who are visiting the website at different times. It is also known as an informational website. In a static website, the only developer can do changes that too in code only. This type of website will not have any major functionalities and it purely depends on UI design.

Testing a simple static website is very easy, you have to consider only a few things while testing. Some of them are mentioned below:

Points to Remember:

#1) Testing the GUI design is a must because a static website purely depends on it. You need to compare the approved PSD files with web page developed. Check all the elements in the design should present on the developed page.

#2) The other part of GUI design is to check the font size, font style, spacing, and color everything has been reproduced.

[This image explains the spacing alignment issue in the desktop view of a website.]

#3) Secondly, you need to check the links (page links) whether it is properly working or not? And also find, is there any broken link?

#4) Verify the spelling and content in all web pages by comparing the content given by the client.

#5) In some cases image will not display properly, it may break or sometimes images gets duplicated, wrong images may display. It has to be checked keenly. Because for a static website, only content and images will give lives.

#6) Check the scroll bar carefully, in my experience, I have faced issues with the scrollbar. The issue you will face is unwanted scrolling appears or scroll gets hidden (it may hide the contents). The above issues are applicable to both horizontal and vertical scrolls.

#7) If there is a contact form check it is working properly by sending some dummy messages.

Things to check in the contact form are:

  • Whether the message is sending properly and a success message appears?
  • Check the email received to the concerned person in the proper format as designed?
  • Check email should not land in spam as junk mail?
  • If there is a reply email trigger is activated then check whether the sender received mail?

#8) Check whether it is an error-free web page, validate it with W3 validator or other related software.

#9) Some constant things to be checked in a static website,

  • Check favicon is present on the tab bar
  • URL should contain the correct page title
  • If copyright information is there, it should be displayed
  • If there is a contact form, Captcha is a must. [It prevents junk email]
  • Check the loading speed of the website. [A static website should not take much time for loading]. If a gif image is used while loading then track its functionality

Apart from these, there are huge things that have to be tested at the backend of every website that is system testing, security testing, interface testing, compatibility testing, and performance testing, etc. For this, you need to have technical knowledge. In a simple static website, you will not find more functionalities if there you need to do functionality testing too.

#2) Dynamic Web Application [CMS Website]

It is the type where the user can update and change their website content regularly. From here I am going to use the word “web application testing” instead of dynamic website testing. The web application is a combination of front-end and back-end programming.

The front-end will be HTML and CSS whereas back-end uses programming languages like PHP, Javascript, and ASP etc. With this backend, user/client can add or change the content on the website.

Testing a web application is not easy than testing a static website but not much difficult than testing an e-commerce website. Functionality testing is the most important thing to be performed while testing a web application. The web application may contain much-complicated functionality so tester needs to be very careful while testing.

There are two different types of web applications are there, one is no action will be carried out by the user in front-end (i.e. only back-end changes will reflect in front-end) the other is end-user will work in front-end itself (for example login, signup, newsletter subscription, and other similar actions). So testing should be done according to it.

Points to Remember:

The points which I mentioned in static website testing are to be included while testing a web application also. In addition to that, the following things are to be noted.

#1) In GUI section, tooltip is compulsory for all fields and buttons, field alignment (spacing) should be done properly, disabled field/ buttons should be greyed out, fields/ buttons should be in standard format as in SRS, error message should be displayed if something goes wrong, pop-up message should only display at the center of the web page, drop-down menu should not be truncated.

Tab shortcut key should work in all fields and more.

#2) In functionality section, if your web application is having login or sign up functionality then check the mandatory field validation, form validation (i.e. number fields should accept only numbers, not alphabets ), character restriction on fields (i.e. only these many characters can be entered).

Special characters and negative numbers restriction on fields, testing the email functionality, testing the document upload (i.e. only specified document type can be uploaded), timeout functionality, sorting functionality, javascript is working on compatible browsers etc should be tested.

#3) When coming to back-end functionality section, test image uploading for broken images, text entering in the fields is working or not. Back-end update should reflect on front-enddatabase testing (i.e. whether you can add new fields or deleting unwanted fields) all these things are to be performed.

Performance is not much necessary for a web application (dynamic website) since it has very less content. If you need you can do with the tools with which you are familiar. Pick-up some standard online performance tool, if you want to do simple performance testing.

#3) E-commerce Website

An e-commerce website is somewhat complicated when compared to the above two. The tester needs to be very cautious while testing an e-commerce site. There are huge things to be checked in e-commerce sites out of them I just cover some of my experienced issues on e-commerce website testing.

In the GUI section, you need to check all the features as in SRS and the same with the functionality. The functionality will be almost the same for all commercial websites.

Functionality-wise you need to check all pages such as the main page (includes featured products, special offers display, log in details, search functionality) product detail page, category page, placing an order, payment gateway everything has to be tested.

Points to Remember:

#1) Check if the shopping cart is getting updated when you buy or increase the quantity. Check this functionality in all the pages and circumstances.

#2) Check if special coupons and offers are applied to correct orders and you see the discounted price is displaying or not.

[This image explains about free shipping and how it is applied in the payment section]

#3) Sometimes while updating a single product it will get multiplied by considering the number of variations in the product. So check whether the single product is displayed and its variations are displayed correctly. (I faced this problem)

#4) Check if the filter option whether is working exactly. If filtering is been done, based on the category & pricing chosen?

#5) While sign up, super validation should be done. Only the new user can sign up.

#6) If an existing user, added a product to the shopping basket, the wishlist section during their previous login should be saved and displayed during the next login too.

#7) Compare products should work by comparing the products based on some specifications assigned in the back-end.

#8) Check whether the Currency converter is working fine. Based on the country chosen the currency converter should display the relevant price and tax rates.

[On choosing the language Currency will be converted, here USD is meant to be default]

#9) Generally many Plug-ins are used in an e-commerce (WordPress & similar) website, you need to be very careful. The plug-in installation may conflict or affect any other major functionality. So follow up with the plug-ins installation and its usage.

#10) Check whether the social sharing option is working on the individual product or not.

#11) Shipping cost should be generated based on the region selected. And also check the tax rate generation. (It may cause some legal problems, during the end-users purchase).

tax rate

[In this image Shipping and the tax rate is calculated for France region]

#12) Payment gateway should work only if valid card details are given. Validation should apply to the Card number and CCV code number. [It is better to keep validation on the card number field itself].

#13) Email generation on each and every process during purchase should happen (sign up, product ordering, payment successful, order canceled, order received and other email triggers if any).

#14) Check the live chat with some dumpy emails.

Note: Generally E-commerce website will not be developed for mobile compatibility and when coming to the mobile version an app will be generated. In some cases, they will not create an app instead a mobile compatible website will be created. In such cases, you need to check carefully to know if there any missing functionality and UI deviation.

These are some of the issues which I faced and noted while testing an E-commerce website. Apart from this, you need to check all the general things related to an e-commerce website.

#4) Mobile Website

First of all, let’s be clear about a mobile website. Generally people think both a mobile website and mobile application to be the same, but in reality, a mobile website is developed with HTML pages and can be viewed only with an internet connection.

But the mobile app is nothing but an application that can be downloaded and used later without an internet connection. Here many of us get confused and raise a question What is the difference between mobile website & responsive website?

A responsive website means making the content fit into the mobile device size instead of creating a version whereas a mobile website is creating a new version that is not a reflection desktop version. In the mobile website, you will have only limited pages, and unwanted functionalities are removed here.

Testing a mobile website is somewhat tedious rather than other types of websites. It will have separate designs and you need to be careful while testing the functionalities.

Points to Remember:

Important points to consider while testing a mobile website:

  • Usually, we will use an emulator for testing a mobile website and we can get ideal results but I always prefer you to test on real devices. I have faced many issues when I tested in real devices [Especially apple devices]. Real device specifications may conflict with the web pages developed.

[This image explains about simulator testing and the backline issue appearing in it.]

  • GUI & usability testing are more important as it is not the reflection of the desktop version.
  • Performance is another important factor to be considered for mobile website testing. Performance-related issues can be tracked when you test in the real devices.
  • Check whether browsing normal web links from mobile is getting triggered by a mobile link.
  • Check page scrolling, page navigation, text truncation, etc on the mobile website.

Best Web Testing Tools

There is a wide range of testing tools that are available for web app testing.

=> Check this comprehensive list of Most Popular Web Application Testing Tools.

Points to be considered while testing a Website

The websites are essentially client/server applications – with web servers and ‘browser’ clients.

Consideration should be given to the interactions between HTML pages, TCP/IP communications, Internet connections, firewalls, applications that run in web pages (such as applets, javascript, plug-in applications) and applications that run on the server-side (such as CGI scripts, database interfaces, logging applications, dynamic page generators, asp, etc.).

Additionally, there are a wide variety of servers and browsers with various versions of each. They include small but sometimes significant differences between them in terms of variations in connection speeds, rapidly changing technologies, and multiple standards & protocols. The end result of which testing for websites can become a major ongoing effort.

Sample test scenarios for testing a web application

Few other considerations to be included while testing a website are given below.

  • What is the expected load on the server (e.g., number of hits per unit time)?
  • What kind of performance is required under each load condition (such as web server response time, database query response times)?
  • What kind of tools will be required for performance testing (such as web load testing tools, other tools already in-house that can be adapted, web robot downloading tools, etc.)?
  • Who is the target audience? What kind of browsers will they be using? What kind of connection speeds will they be using? Are they intra-organizations (thus likely with high connection speeds and similar browsers) or Internet-wide (thus with a wide variety of connection speeds and browser types)?
  • What kind of performance is expected from the client-side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?
  • Will the downtime for server and content maintenance/upgrades be allowed? If so, then how much?
  • What kind of security (firewalls, encryption, passwords, etc.) will be required and what is it expected to do? How can it be tested?
  • How reliable are the site’s Internet connections required to be? And how does that affect the backup system or redundant connection requirements and testing?
  • What process will be required to manage updates to the web site’s content?
  • What are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?
  • Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?
  • Will there be any standard requirements for page appearance and/or graphics throughout a site or parts of a site??
  • How will internal and external links be validated and updated? And how often? will it happen?
  • Can testing be done on the production system, or will a separate test system be required?
  • How are browser caching, variations in browser option settings, dial-up connection variability, and real-world internet ‘traffic congestion’ problems to be accounted for testing?
  • How extensive or customized are the server logging and reporting requirements; are they considered as an integral part of the system and do they require testing?
  • How are CGI programs, applets, javascript, ActiveX components, etc. to be maintained, tracked, controlled, and tested?
  • Pages should be 3-5 screens max unless the content is highly focused on a single topic. If larger, provide internal links within the page.
  • The page layouts and design elements should be consistent throughout a site so that it’s clear to the user that they are still on a site.
  • Pages should be as browser-independent as possible, or pages should be provided or generated based on the browser type.
  • All pages should have links external to the page; there should be no dead-end pages.
  • The page owner, revision date, and a link to a contact person or organization should be included on each page.

Web Testing FAQs

Below mentioned should be the various questions coming to a tester’s mind while thinking of a website that is already developed and can be exposed to the public:

  • Is the website functioning as expected?
  • Will the end-user find the website easy to browse?
  • Is the website accessible on different devices possessed by end-users?
  • Is the website secured enough?
  • Is the website performance up to the mark?
  • Is the data entered on a website stored accurately and persist across sessions?
  • Is the website integrated well with other interfaces in the workflow?
  • Will the website perform as expected even after going live?

To answer these questions, different testing techniques have been identified that can be used to test a web application.

Let’s take an example of an e-commerce website that has been recently released to the QA team for testing.

We’ll go through each one of the above-specified questions in detail to understand the scope of the test and see how website testing can be performed.

website testing

Is the website functioning as expected?

confirm that the website is functioning well, QA needs to perform functional testing. During functional testing, different features of an application need to be validated against the requirements mentioned in the functional specification document.

Below are a few generic scenarios, a QA is expected to cover while performing functional testing of any website even if they are not mentioned in functional specifications:

  • User navigation to different pages of the website and completing the end-to-end workflow
  • If the user can select/deselect checkboxes
  • If the user can select values from Dropdown fields
  • If the user can select/deselect Radio buttons
  • Different navigation buttons like Submit, Next, Upload etc. buttons are working well
  • Calendars are loading properly and allowing the user to select a date
  • Calculations are happening as implemented
  • Search functionality is working if any
  • Correct Information display
  • Various internal & external links to other pages
  • Correct Tab Order of the fields on web pages
  • Mandatory and Optional fields should be verified for the positive and negative inputs
  • Default values for each web field should be verified
  • Email functionality is implemented for some action on the website

It’s important for websites to be compatible with search engines. Hence we should review websites for HTML syntax correctness, format & compliance standards like WS-I, ISO & ECMA.

Considering cookies, which are used to maintain login sessions, the website should be tested by enabling/disabling cookies or by using the mismatched domain. Testing can also be performed across sessions by resetting cookies to bring browsers back to the vanilla state.

QA should also validate that website cookies are always stored locally in an encrypted format.

Considering our e-commerce website, various links like Men’s Fashion, Women’s Fashion, Kid’s Fashion, Home Accessories, Electronic Appliances, Books, Movies & Music, etc. available on a web page should be clicked on and verified if the user navigates to the expected page.

Similarly, different functionalities like Login, Signup, Search Option, Filters, Sort Order, Add to Cart, etc. should be verified on different web pages like Login Page, Sign up Page, Product Details Page, Shopping Cart, Order Review, Payment, etc. The website should be checked for session/cookie management like session expiration and session storage etc.

Will the end-user find the website easy to browse?

Usability testing has to be performed to measure the website’s ease of use for an end-user in the context of accessibility, searchability, and usefulness, etc.

Usability testing

Below mentioned are few of the test scenarios that should be verified while performing usability testing for a website:

  • Website content should be informative, structured and linked logically so that user can understand easily
  • Web page controls should be easy for users to navigate
  • The website should have Help & Instruction documents uploaded
  • The website should have the Search feature for end-user convenience
  • Access to/from the Main menu to all pages should be there
  • Website content should be verified for any spelling mistakes
  • The website should follow defined guidelines in the context of background color, pattern, style, fonts, image placements, frames, borders, etc.
  • The website should be accustomed to the translation feature considering the fact that it can be accessed by users from different nations with different languages, currencies, etc.

Few tools that can be used to perform usability testing are User Zoom and Reflector.

An e-commerce website should be customer-friendly, easy-to-navigate and attention-grabbing. All web pages should be verified for accessibility, fonts, styling, images, spelling mistakes and product relevant information. A website should be equipped with relevant help documents and customer support facilities.

Considering the increase in touchscreen-based interfaces we need to validate the accessibility of both key inputs and touch screen inputs. Similarly, images and website content should be validated for usability on different screen sizes (mobiles, laptops, and tabs, etc.).

Is the website accessible on different devices possessed by end-users?

Assuming that our website can be accessed by a range of users with a different set of devices, we need to ensure that the website runs well on all of them without any glitches.

To ensure the same, website compatibility checks should be done which comes with Compatibility Testing. During compatibility testing of a website, it is ensured that the website runs well on different browsers, Operating Systems & Devices like laptops, mobile phones, tablets, printers, etc.

Browsers Compatibility (Cross Browser Testing):

The website should work well with different browsers like Microsoft Internet Explorer, Microsoft Edge, Firefox, Google Chrome, Safari, and Opera. All active versions of these browsers should be verified with different browser features turned ON/OFF.

Also, while performing cross-browser testing, QA should also check for the optimal website performance across browsers.

Operating System Compatibility (Cross Platform Testing):

In order to identify potential user experience issues, a website should be tested on various platforms like Windows, Linux, Unix.MAC, Solaris, etc. so as to be sure of the OS compatibility.

Device Compatibility (Cross-Device Testing):

A website can be browsed through different devices like laptops, mobiles, tablets, etc. with different OS available like iOS, Android, Windows, etc. Hence, testing should be performed on the devices too covering the below scenarios.

  • Website screen size should be adjustable as per the device
  • A device should be screen rotation featured
  • The website should not show up any loading issues on different devices with different network speeds
  • Verify the website behavior when the device is in/out of network range
  • Verify the website behavior on low CPU and Memory to support different form factors

For an e-commerce website, the compatibility check is one of the most important testing types. The customer base will be large and will access our website from different browsers, operating systems & devices.

Considering mobile platforms are becoming popular, we should ensure website load on small form factor under acceptable load time. It is also important to validate the use of different network speed to ensure it is usable for all customers.

Is the website secured enough?

Security testing is performed to uncover vulnerabilities in a system and ensure a website is secured.

Below is the checklist that can be verified while performing security testing:

  • The website should be accessible to only authenticated users
  • Website users should be able to perform only those tasks for which they are authorized
  • The website should be verified for CAPTCHA fields for user identification
  • Browser security settings should be verified while moving from secure to insecure pages
  • Web Server protection should be there for inaccessible web directories or files
  • Ensure restricted files should not download without appropriate access
  • Sessions which got inactive should automatically get killed after a certain period of time
  • All invalid and unauthorized attempts by end-users or intermittent system errors/failures should get logged for analysis purpose

Tools like Retina CS Community, Veracode, and SQL Map can be used to perform security testing of your website.

As a part of security testing, an e-commerce website should be validated for

  1. Website Access Controls.
  2. Any leakage of user personal info.
  3. Secured Payment Methods.

Is the website performance up to the mark?

To check the performance of a website, performance testing can be done. It will evaluate the behavior of an application under a variety of workload conditions which could be a realistic scenario. If the system goes live without conducting performance tests, it may end up with issues like a slow running system or poor usability which likely will affect the brand image as well as market sales.

A website can be tested against load & stress.

Below given is the checklist for web performance testing:

  • Website behavior should be observed under normal and peak load conditions
  • Website’s performance should be examined by measuring response time, speed, scalability and resource utilization
  • Proper RCA (root cause analysis) should be done with a solution if a system breaks down or gets unstable at any point in time
  • Network latency issues should be identified if any

An e-commerce website should be tested thoroughly using a set of simulated users during normal as well as peak load conditions which can be during ‘Sale Season’.

During the sale, users accessing the website would multiply. Also, website behavior should be examined while multiple concurrent users accessing the same items or performing the same actions (like transactions or placing orders) on the website.

There are various tools available in the market for performance testing. Few of them are LoadRunner, WinRunner, Silk Performer, JMeter, etc.

Is the data entered on a website stored accurately and persist across sessions?

The database is one of the critical components of a web application that holds the complete information entered through a website. Hence, to make sure that correct user data is getting saved in database tables without any manipulations and to maintain data integrity below verifications should be performed.

  • Verify data consistency across user interface i.e. Website UI and Database
  • Verify that DB tables are updating properly whenever insert/update/delete actions are performed by a website application
  • Verify the response time of technical queries and fine-tune them if required
  • Check for DB connectivity and access permissions

As a QA team member testing e-commerce website, you can perform below activities and validate the changes each time in the corresponding database tables. This will make sure that website UI and DB, both are consistent.

1) Placing an Order for a product.

2) Canceling Product.

3) Opt to Exchange Product.

4) Opt to Return Product.

Is the website integrated well with other interfaces in the workflow?

Interface level testing is performed to check on the smooth interaction of the website with different interfaces like Web Server & Database Server.

During interface testing, the tester needs to make sure if the application requests are being sent properly to the database and correct information is displayed to the client as output. A webserver should not throw any denial exceptions at any point in time and the database should always stay in sync with the application.

Will the website perform as expected even after going live?

Once a product moves into a production environment, the regular inspection should be done to keep a check on quality control.

Below scenarios can be considered while verifying product in production:

  • Web application tests should be executed periodically and test logs should be saved as proof of Service Level Agreement (SLA) compliant
  • Auto-scaling systems and load balancers should be checked if in place and functioning
  • Keep a check the end-user experiences and try to uncover defects or malicious attacks which typically goes unnoticed during QA testing
  • Monitor the product response time during peak loads
  • Execute edge level test cases in real-time to identify network failures, connection failures or interruption by an unexpected call

Conclusion

I have drafted this detailed tutorial with my years of experience testing the different websites.

Hope this article helps you understand the different facets of web application testing. Next time when you sit to write a test plan for your website do remember to validate various aspects beyond the functionality of the website.

React Tutorial

This tutorial doesn’t assume any existing React knowledge. Original page at  https://reactjs.org/tutorial/tutorial.html

Before We Start the Tutorial {#before-we-start-the-tutorial}

We will build a small game during this tutorial. You might be tempted to skip it because you’re not building games — but give it a chance. The techniques you’ll learn in the tutorial are fundamental to building any React app, and mastering it will give you a deep understanding of React.

Tip

This tutorial is designed for people who prefer to learn by doing. If you prefer learning concepts from the ground up, check out our step-by-step guide. You might find this tutorial and the guide complementary to each other.

The tutorial is divided into several sections:

  • Setup for the Tutorial will give you a starting point to follow the tutorial.
  • Overview will teach you the fundamentals of React: components, props, and state.
  • Completing the Game will teach you the most common techniques in React development.
  • Adding Time Travel will give you a deeper insight into the unique strengths of React.

You don’t have to complete all of the sections at once to get the value out of this tutorial. Try to get as far as you can — even if it’s one or two sections.

What Are We Building? {#what-are-we-building}

In this tutorial, we’ll show how to build an interactive tic-tac-toe game with React.

You can see what we’ll be building here: Final Result. If the code doesn’t make sense to you, or if you are unfamiliar with the code’s syntax, don’t worry! The goal of this tutorial is to help you understand React and its syntax.

We recommend that you check out the tic-tac-toe game before continuing with the tutorial. One of the features that you’ll notice is that there is a numbered list to the right of the game’s board. This list gives you a history of all of the moves that have occurred in the game, and it is updated as the game progresses.

You can close the tic-tac-toe game once you’re familiar with it. We’ll be starting from a simpler template in this tutorial. Our next step is to set you up so that you can start building the game.

Prerequisites {#prerequisites}

We’ll assume that you have some familiarity with HTML and JavaScript, but you should be able to follow along even if you’re coming from a different programming language. We’ll also assume that you’re familiar with programming concepts like functions, objects, arrays, and to a lesser extent, classes.

If you need to review JavaScript, we recommend reading this guide. Note that we’re also using some features from ES6 — a recent version of JavaScript. In this tutorial, we’re using arrow functionsclasseslet, and const statements. You can use the Babel REPL to check what ES6 code compiles to.

Setup for the Tutorial {#setup-for-the-tutorial}

There are two ways to complete this tutorial: you can either write the code in your browser, or you can set up a local development environment on your computer.

Setup Option 1: Write Code in the Browser {#setup-option-1-write-code-in-the-browser}

This is the quickest way to get started!

First, open this Starter Code in a new tab. The new tab should display an empty tic-tac-toe game board and React code. We will be editing the React code in this tutorial.

You can now skip the second setup option, and go to the Overview section to get an overview of React.

Setup Option 2: Local Development Environment {#setup-option-2-local-development-environment}

This is completely optional and not required for this tutorial!

 

Optional: Instructions for following along locally using your preferred text editor

Help, I’m Stuck! {#help-im-stuck}

If you get stuck, check out the community support resources. In particular, Reactiflux Chat is a great way to get help quickly. If you don’t receive an answer, or if you remain stuck, please file an issue, and we’ll help you out.

Overview {#overview}

Now that you’re set up, let’s get an overview of React!

What Is React? {#what-is-react}

React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”.

React has a few different kinds of components, but we’ll start with React.Component subclasses:

class ShoppingList extends React.Component {
  render() {
    return (

 

Shopping List for {this.props.name}

 

    • Instagram

 

    • WhatsApp

 

    • Oculus

 

 

); } } // Example usage:

We’ll get to the funny XML-like tags soon. We use components to tell React what we want to see on the screen. When our data changes, React will efficiently update and re-render our components.

Here, ShoppingList is a React component class, or React component type. A component takes in parameters, called props (short for “properties”), and returns a hierarchy of views to display via the render method.

The render method returns a description of what you want to see on the screen. React takes the description and displays the result. In particular, render returns a React element, which is a lightweight description of what to render. Most React developers use a special syntax called “JSX” which makes these structures easier to write. The 

 

 syntax is transformed at build time to React.createElement('div'). The example above is equivalent to:

return React.createElement('div', {className: 'shopping-list'},
  React.createElement('h1', /* ... h1 children ... */),
  React.createElement('ul', /* ... ul children ... */)
);

See full expanded version.

If you’re curious, createElement() is described in more detail in the API reference, but we won’t be using it in this tutorial. Instead, we will keep using JSX.

JSX comes with the full power of JavaScript. You can put any JavaScript expressions within braces inside JSX. Each React element is a JavaScript object that you can store in a variable or pass around in your program.

The ShoppingList component above only renders built-in DOM components like 

 

 and 

  •  
. But you can compose and render custom React components too. For example, we can now refer to the whole shopping list by writing . Each React component is encapsulated and can operate independently; this allows you to build complex UIs from simple components.

Inspecting the Starter Code {#inspecting-the-starter-code}

If you’re going to work on the tutorial in your browser, open this code in a new tab: Starter Code. If you’re going to work on the tutorial locally, instead open src/index.js in your project folder (you have already touched this file during the setup).

This Starter Code is the base of what we’re building. We’ve provided the CSS styling so that you only need to focus on learning React and programming the tic-tac-toe game.

By inspecting the code, you’ll notice that we have three React components:

  • Square
  • Board
  • Game

The Square component renders a single  and the Board renders 9 squares. The Game component renders a board with placeholder values which we’ll modify later. There are currently no interactive components.

Passing Data Through Props {#passing-data-through-props}

To get our feet wet, let’s try passing some data from our Board component to our Square component.

We strongly recommend typing code by hand as you’re working through the tutorial and not using copy/paste. This will help you develop muscle memory and a stronger understanding.

In Board’s renderSquare method, change the code to pass a prop called value to the Square:

class Board extends React.Component {
  renderSquare(i) {
    return ;
  }
}

Change Square’s render method to show that value by replacing {/* TODO */} with {this.props.value}:

class Square extends React.Component {
  render() {
    return (
      
    );
  }
}

Before:

React Devtools

After: You should see a number in each square in the rendered output.

React Devtools

View the full code at this point

Congratulations! You’ve just “passed a prop” from a parent Board component to a child Square component. Passing props is how information flows in React apps, from parents to children.

Making an Interactive Component {#making-an-interactive-component}

Let’s fill the Square component with an “X” when we click it. First, change the button tag that is returned from the Square component’s render() function to this:

class Square extends React.Component {
  render() {
    return (
      
    );
  }
}

If you click on a Square now, you should see an alert in your browser.

Note

To save typing and avoid the confusing behavior of this, we will use the arrow function syntax for event handlers here and further below:

class Square extends React.Component {
 render() {
   return (
     
   );
 }
}

Notice how with onClick={() => alert('click')}, we’re passing a function as the onClick prop. React will only call this function after a click. Forgetting () => and writing onClick={alert('click')} is a common mistake, and would fire the alert every time the component re-renders.

As a next step, we want the Square component to “remember” that it got clicked, and fill it with an “X” mark. To “remember” things, components use state.

React components can have state by setting this.state in their constructors. this.state should be considered as private to a React component that it’s defined in. Let’s store the current value of the Square in this.state, and change it when the Square is clicked.

First, we’ll add a constructor to the class to initialize the state:

class Square extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      value: null,
    };
  }

  render() {
    return (
      
    );
  }
}

Note

In JavaScript classes, you need to always call super when defining the constructor of a subclass. All React component classes that have a constructor should start with a super(props) call.

Now we’ll change the Square’s render method to display the current state’s value when clicked:

  • Replace this.props.value with this.state.value inside the  tag.
  • Replace the onClick={...} event handler with onClick={() => this.setState({value: 'X'})}.
  • Put the className and onClick props on separate lines for better readability.

After these changes, the  tag that is returned by the Square’s render method looks like this:

class Square extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      value: null,
    };
  }

  render() {
    return (
      
    );
  }
}

By calling this.setState from an onClick handler in the Square’s render method, we tell React to re-render that Square whenever its  is clicked. After the update, the Square’s this.state.value will be 'X', so we’ll see the X on the game board. If you click on any Square, an X should show up.

When you call setState in a component, React automatically updates the child components inside of it too.

View the full code at this point

Developer Tools {#developer-tools}

The React Devtools extension for Chrome and Firefox lets you inspect a React component tree with your browser’s developer tools.

React Devtools

The React DevTools let you check the props and the state of your React components.

After installing React DevTools, you can right-click on any element on the page, click “Inspect” to open the developer tools, and the React tabs (“⚛️ Components” and “⚛️ Profiler”) will appear as the last tabs to the right. Use “⚛️ Components” to inspect the component tree.

However, note there are a few extra steps to get it working with CodePen:

  1. Log in or register and confirm your email (required to prevent spam).
  2. Click the “Fork” button.
  3. Click “Change View” and then choose “Debug mode”.
  4. In the new tab that opens, the devtools should now have a React tab.

Completing the Game {#completing-the-game}

We now have the basic building blocks for our tic-tac-toe game. To have a complete game, we now need to alternate placing “X”s and “O”s on the board, and we need a way to determine a winner.

Lifting State Up {#lifting-state-up}

Currently, each Square component maintains the game’s state. To check for a winner, we’ll maintain the value of each of the 9 squares in one location.

We may think that Board should just ask each Square for the Square’s state. Although this approach is possible in React, we discourage it because the code becomes difficult to understand, susceptible to bugs, and hard to refactor. Instead, the best approach is to store the game’s state in the parent Board component instead of in each Square. The Board component can tell each Square what to display by passing a prop, just like we did when we passed a number to each Square.

To collect data from multiple children, or to have two child components communicate with each other, you need to declare the shared state in their parent component instead. The parent component can pass the state back down to the children by using props; this keeps the child components in sync with each other and with the parent component.

Lifting state into a parent component is common when React components are refactored — let’s take this opportunity to try it out.

Add a constructor to the Board and set the Board’s initial state to contain an array of 9 nulls corresponding to the 9 squares:

class Board extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      squares: Array(9).fill(null),
    };
  }

  renderSquare(i) {
    return ;
  }

When we fill the board in later, the this.state.squares array will look something like this:

[
  'O', null, 'X',
  'X', 'X', 'O',
  'O', null, null,
]

The Board’s renderSquare method currently looks like this:

  renderSquare(i) {
    return ;
  }

In the beginning, we passed the value prop down from the Board to show numbers from 0 to 8 in every Square. In a different previous step, we replaced the numbers with an “X” mark determined by Square’s own state. This is why Square currently ignores the value prop passed to it by the Board.

We will now use the prop passing mechanism again. We will modify the Board to instruct each individual Square about its current value ('X''O', or null). We have already defined the squares array in the Board’s constructor, and we will modify the Board’s renderSquare method to read from it:

  renderSquare(i) {
    return ;
  }

View the full code at this point

Each Square will now receive a value prop that will either be 'X''O', or null for empty squares.

Next, we need to change what happens when a Square is clicked. The Board component now maintains which squares are filled. We need to create a way for the Square to update the Board’s state. Since state is considered to be private to a component that defines it, we cannot update the Board’s state directly from Square.

Instead, we’ll pass down a function from the Board to the Square, and we’ll have Square call that function when a square is clicked. We’ll change the renderSquare method in Board to:

  renderSquare(i) {
    return (
       this.handleClick(i)}
      />
    );
  }

Note

We split the returned element into multiple lines for readability, and added parentheses so that JavaScript doesn’t insert a semicolon after return and break our code.

Now we’re passing down two props from Board to Square: value and onClick. The onClick prop is a function that Square can call when clicked. We’ll make the following changes to Square:

  • Replace this.state.value with this.props.value in Square’s render method
  • Replace this.setState() with this.props.onClick() in Square’s render method
  • Delete the constructor from Square because Square no longer keeps track of the game’s state

After these changes, the Square component looks like this:

class Square extends React.Component {
  render() {
    return (
      
    );
  }
}

When a Square is clicked, the onClick function provided by the Board is called. Here’s a review of how this is achieved:

  1. The onClick prop on the built-in DOM  component tells React to set up a click event listener.
  2. When the button is clicked, React will call the onClick event handler that is defined in Square’s render() method.
  3. This event handler calls this.props.onClick(). The Square’s onClick prop was specified by the Board.
  4. Since the Board passed onClick={() => this.handleClick(i)} to Square, the Square calls this.handleClick(i) when clicked.
  5. We have not defined the handleClick() method yet, so our code crashes. If you click a square now, you should see a red error screen saying something like “this.handleClick is not a function”.

Note

The DOM  element’s onClick attribute has a special meaning to React because it is a built-in component. For custom components like Square, the naming is up to you. We could give any name to the Square’s onClick prop or Board’s handleClick method, and the code would work the same. In React, it’s conventional to use on[Event] names for props which represent events and handle[Event] for the methods which handle the events.

When we try to click a Square, we should get an error because we haven’t defined handleClick yet. We’ll now add handleClick to the Board class:

class Board extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      squares: Array(9).fill(null),
    };
  }

  handleClick(i) {
    const squares = this.state.squares.slice();
    squares[i] = 'X';
    this.setState({squares: squares});
  }

  renderSquare(i) {
    return (
       this.handleClick(i)}
      />
    );
  }

  render() {
    const status = 'Next player: X';

    return (

 

{status}

 

{this.renderSquare(0)} {this.renderSquare(1)} {this.renderSquare(2)}

 

{this.renderSquare(3)} {this.renderSquare(4)} {this.renderSquare(5)}

 

{this.renderSquare(6)} {this.renderSquare(7)} {this.renderSquare(8)}

 

); } }

View the full code at this point

After these changes, we’re again able to click on the Squares to fill them, the same as we had before. However, now the state is stored in the Board component instead of the individual Square components. When the Board’s state changes, the Square components re-render automatically. Keeping the state of all squares in the Board component will allow it to determine the winner in the future.

Since the Square components no longer maintain state, the Square components receive values from the Board component and inform the Board component when they’re clicked. In React terms, the Square components are now controlled components. The Board has full control over them.

Note how in handleClick, we call .slice() to create a copy of the squares array to modify instead of modifying the existing array. We will explain why we create a copy of the squares array in the next section.

Why Immutability Is Important {#why-immutability-is-important}

In the previous code example, we suggested that you use the .slice() method to create a copy of the squares array to modify instead of modifying the existing array. We’ll now discuss immutability and why immutability is important to learn.

There are generally two approaches to changing data. The first approach is to mutate the data by directly changing the data’s values. The second approach is to replace the data with a new copy which has the desired changes.

Data Change with Mutation {#data-change-with-mutation}

var player = {score: 1, name: 'Jeff'};
player.score = 2;
// Now player is {score: 2, name: 'Jeff'}

Data Change without Mutation {#data-change-without-mutation}

var player = {score: 1, name: 'Jeff'};

var newPlayer = Object.assign({}, player, {score: 2});
// Now player is unchanged, but newPlayer is {score: 2, name: 'Jeff'}

// Or if you are using object spread syntax proposal, you can write:
// var newPlayer = {...player, score: 2};

The end result is the same but by not mutating (or changing the underlying data) directly, we gain several benefits described below.

Complex Features Become Simple {#complex-features-become-simple}

Immutability makes complex features much easier to implement. Later in this tutorial, we will implement a “time travel” feature that allows us to review the tic-tac-toe game’s history and “jump back” to previous moves. This functionality isn’t specific to games — an ability to undo and redo certain actions is a common requirement in applications. Avoiding direct data mutation lets us keep previous versions of the game’s history intact, and reuse them later.

Detecting Changes {#detecting-changes}

Detecting changes in mutable objects is difficult because they are modified directly. This detection requires the mutable object to be compared to previous copies of itself and the entire object tree to be traversed.

Detecting changes in immutable objects is considerably easier. If the immutable object that is being referenced is different than the previous one, then the object has changed.

Determining When to Re-Render in React {#determining-when-to-re-render-in-react}

The main benefit of immutability is that it helps you build pure components in React. Immutable data can easily determine if changes have been made which helps to determine when a component requires re-rendering.

You can learn more about shouldComponentUpdate() and how you can build pure components by reading Optimizing Performance.

Function Components {#function-components}

We’ll now change the Square to be a function component.

In React, function components are a simpler way to write components that only contain a render method and don’t have their own state. Instead of defining a class which extends React.Component, we can write a function that takes props as input and returns what should be rendered. Function components are less tedious to write than classes, and many components can be expressed this way.

Replace the Square class with this function:

function Square(props) {
  return (
    
  );
}

We have changed this.props to props both times it appears.

View the full code at this point

Note

When we modified the Square to be a function component, we also changed onClick={() => this.props.onClick()} to a shorter onClick={props.onClick} (note the lack of parentheses on both sides).

Taking Turns {#taking-turns}

We now need to fix an obvious defect in our tic-tac-toe game: the “O”s cannot be marked on the board.

We’ll set the first move to be “X” by default. We can set this default by modifying the initial state in our Board constructor:

class Board extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      squares: Array(9).fill(null),
      xIsNext: true,
    };
  }

Each time a player moves, xIsNext (a boolean) will be flipped to determine which player goes next and the game’s state will be saved. We’ll update the Board’s handleClick function to flip the value of xIsNext:

  handleClick(i) {
    const squares = this.state.squares.slice();
    squares[i] = this.state.xIsNext ? 'X' : 'O';
    this.setState({
      squares: squares,
      xIsNext: !this.state.xIsNext,
    });
  }

With this change, “X”s and “O”s can take turns. Try it!

Let’s also change the “status” text in Board’s render so that it displays which player has the next turn:

  render() {
    const status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');

    return (
      // the rest has not changed

After applying these changes, you should have this Board component:

class Board extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      squares: Array(9).fill(null),
      xIsNext: true,
    };
  }

  handleClick(i) {
    const squares = this.state.squares.slice();
    squares[i] = this.state.xIsNext ? 'X' : 'O';
    this.setState({
      squares: squares,
      xIsNext: !this.state.xIsNext,
    });
  }

  renderSquare(i) {
    return (
       this.handleClick(i)}
      />
    );
  }

  render() {
    const status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');

    return (

 

{status}

 

{this.renderSquare(0)} {this.renderSquare(1)} {this.renderSquare(2)}

 

{this.renderSquare(3)} {this.renderSquare(4)} {this.renderSquare(5)}

 

{this.renderSquare(6)} {this.renderSquare(7)} {this.renderSquare(8)}

 

); } }

View the full code at this point

Declaring a Winner {#declaring-a-winner}

Now that we show which player’s turn is next, we should also show when the game is won and there are no more turns to make. Copy this helper function and paste it at the end of the file:

function calculateWinner(squares) {
  const lines = [
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
    [0, 3, 6],
    [1, 4, 7],
    [2, 5, 8],
    [0, 4, 8],
    [2, 4, 6],
  ];
  for (let i = 0; i < lines.length; i++) {
    const [a, b, c] = lines[i];
    if (squares[a] && squares[a] === squares[b] && squares[a] === squares[c]) {
      return squares[a];
    }
  }
  return null;
}

Given an array of 9 squares, this function will check for a winner and return 'X''O', or null as appropriate.

We will call calculateWinner(squares) in the Board’s render function to check if a player has won. If a player has won, we can display text such as “Winner: X” or “Winner: O”. We’ll replace the status declaration in Board’s render function with this code:

  render() {
    const winner = calculateWinner(this.state.squares);
    let status;
    if (winner) {
      status = 'Winner: ' + winner;
    } else {
      status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');
    }

    return (
      // the rest has not changed

We can now change the Board’s handleClick function to return early by ignoring a click if someone has won the game or if a Square is already filled:

  handleClick(i) {
    const squares = this.state.squares.slice();
    if (calculateWinner(squares) || squares[i]) {
      return;
    }
    squares[i] = this.state.xIsNext ? 'X' : 'O';
    this.setState({
      squares: squares,
      xIsNext: !this.state.xIsNext,
    });
  }

View the full code at this point

Congratulations! You now have a working tic-tac-toe game. And you’ve just learned the basics of React too. So you’re probably the real winner here.

Adding Time Travel {#adding-time-travel}

As a final exercise, let’s make it possible to “go back in time” to the previous moves in the game.

Storing a History of Moves {#storing-a-history-of-moves}

If we mutated the squares array, implementing time travel would be very difficult.

However, we used slice() to create a new copy of the squares array after every move, and treated it as immutable. This will allow us to store every past version of the squares array, and navigate between the turns that have already happened.

We’ll store the past squares arrays in another array called history. The history array represents all board states, from the first to the last move, and has a shape like this:

history = [
  // Before first move
  {
    squares: [
      null, null, null,
      null, null, null,
      null, null, null,
    ]
  },
  // After first move
  {
    squares: [
      null, null, null,
      null, 'X', null,
      null, null, null,
    ]
  },
  // After second move
  {
    squares: [
      null, null, null,
      null, 'X', null,
      null, null, 'O',
    ]
  },
  // ...
]

Now we need to decide which component should own the history state.

Lifting State Up, Again {#lifting-state-up-again}

We’ll want the top-level Game component to display a list of past moves. It will need access to the history to do that, so we will place the history state in the top-level Game component.

Placing the history state into the Game component lets us remove the squares state from its child Board component. Just like we “lifted state up” from the Square component into the Board component, we are now lifting it up from the Board into the top-level Game component. This gives the Game component full control over the Board’s data, and lets it instruct the Board to render previous turns from the history.

First, we’ll set up the initial state for the Game component within its constructor:

class Game extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      history: [{
        squares: Array(9).fill(null),
      }],
      xIsNext: true,
    };
  }

  render() {
    return (

 

 

 

 

{/* status */}

 

    {/* TODO */}

 

 

); } }

Next, we’ll have the Board component receive squares and onClick props from the Game component. Since we now have a single click handler in Board for many Squares, we’ll need to pass the location of each Square into the onClick handler to indicate which Square was clicked. Here are the required steps to transform the Board component:

  • Delete the constructor in Board.
  • Replace this.state.squares[i] with this.props.squares[i] in Board’s renderSquare.
  • Replace this.handleClick(i) with this.props.onClick(i) in Board’s renderSquare.

The Board component now looks like this:

class Board extends React.Component {
  handleClick(i) {
    const squares = this.state.squares.slice();
    if (calculateWinner(squares) || squares[i]) {
      return;
    }
    squares[i] = this.state.xIsNext ? 'X' : 'O';
    this.setState({
      squares: squares,
      xIsNext: !this.state.xIsNext,
    });
  }

  renderSquare(i) {
    return (
       this.props.onClick(i)}
      />
    );
  }

  render() {
    const winner = calculateWinner(this.state.squares);
    let status;
    if (winner) {
      status = 'Winner: ' + winner;
    } else {
      status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');
    }

    return (

 

{status}

 

{this.renderSquare(0)} {this.renderSquare(1)} {this.renderSquare(2)}

 

{this.renderSquare(3)} {this.renderSquare(4)} {this.renderSquare(5)}

 

{this.renderSquare(6)} {this.renderSquare(7)} {this.renderSquare(8)}

 

); } }

We’ll update the Game component’s render function to use the most recent history entry to determine and display the game’s status:

  render() {
    const history = this.state.history;
    const current = history[history.length - 1];
    const winner = calculateWinner(current.squares);

    let status;
    if (winner) {
      status = 'Winner: ' + winner;
    } else {
      status = 'Next player: ' + (this.state.xIsNext ? 'X' : 'O');
    }

    return (

 

this.handleClick(i)} />

 

 

{status}

 

    {/* TODO */}

 

 

); }

Since the Game component is now rendering the game’s status, we can remove the corresponding code from the Board’s render method. After refactoring, the Board’s render function looks like this:

  render() {
    return (

 

{this.renderSquare(0)} {this.renderSquare(1)} {this.renderSquare(2)}

 

{this.renderSquare(3)} {this.renderSquare(4)} {this.renderSquare(5)}

 

{this.renderSquare(6)} {this.renderSquare(7)} {this.renderSquare(8)}

 

); }

Finally, we need to move the handleClick method from the Board component to the Game component. We also need to modify handleClick because the Game component’s state is structured differently. Within the Game’s handleClick method, we concatenate new history entries onto history.

  handleClick(i) {
    const history = this.state.history;
    const current = history[history.length - 1];
    const squares = current.squares.slice();
    if (calculateWinner(squares) || squares[i]) {
      return;
    }
    squares[i] = this.state.xIsNext ? 'X' : 'O';
    this.setState({
      history: history.concat([{
        squares: squares,
      }]),
      xIsNext: !this.state.xIsNext,
    });
  }

Note

Unlike the array push() method you might be more familiar with, the concat() method doesn’t mutate the original array, so we prefer it.

At this point, the Board component only needs the renderSquare and render methods. The game’s state and the handleClick method should be in the Game component.

View the full code at this point

Showing the Past Moves {#showing-the-past-moves}

Since we are recording the tic-tac-toe game’s history, we can now display it to the player as a list of past moves.

We learned earlier that React elements are first-class JavaScript objects; we can pass them around in our applications. To render multiple items in React, we can use an array of React elements.

In JavaScript, arrays have a map() method that is commonly used for mapping data to other data, for example:

const numbers = [1, 2, 3];
const doubled = numbers.map(x => x * 2); // [2, 4, 6]

Using the map method, we can map our history of moves to React elements representing buttons on the screen, and display a list of buttons to “jump” to past moves.

Let’s map over the history in the Game’s render method:

  render() {
    const history = this.state.history;
    const current = history[history.length - 1];
    const winner = calculateWinner(current.squares);

    const moves = history.map((step, move) => {
      const desc = move ?
        'Go to move #' + move :
        'Go to game start';
      return (

); }); let status; if (winner) { status = ‘Winner: ‘ + winner; } else { status = ‘Next player: ‘ + (this.state.xIsNext ? ‘X’ : ‘O’); } return (

 

this.handleClick(i)} />

 

 

{status}

 

    {moves}

 

 

); }

View the full code at this point

For each move in the tic-tac-toe game’s history, we create a list item 

  •  which contains a button . The button has a onClick handler which calls a method called this.jumpTo(). We haven’t implemented the jumpTo() method yet. For now, we should see a list of the moves that have occurred in the game and a warning in the developer tools console that says:

    Warning: Each child in an array or iterator should have a unique “key” prop. Check the render method of “Game”.

    Let’s discuss what the above warning means.

    Picking a Key {#picking-a-key}

    When we render a list, React stores some information about each rendered list item. When we update a list, React needs to determine what has changed. We could have added, removed, re-arranged, or updated the list’s items.

    Imagine transitioning from

     
  • Alexa: 7 tasks left
  •  

     
  • Ben: 5 tasks left
  •  

    to

     
  • Ben: 9 tasks left
  •  

     
  • Claudia: 8 tasks left
  •  

     
  • Alexa: 5 tasks left
  •  

    In addition to the updated counts, a human reading this would probably say that we swapped Alexa and Ben’s ordering and inserted Claudia between Alexa and Ben. However, React is a computer program and does not know what we intended. Because React cannot know our intentions, we need to specify a key property for each list item to differentiate each list item from its siblings. One option would be to use the strings alexabenclaudia. If we were displaying data from a database, Alexa, Ben, and Claudia’s database IDs could be used as keys.

     
  • {user.name}: {user.taskCount} tasks left
  •  

    When a list is re-rendered, React takes each list item’s key and searches the previous list’s items for a matching key. If the current list has a key that didn’t exist before, React creates a component. If the current list is missing a key that existed in the previous list, React destroys the previous component. If two keys match, the corresponding component is moved. Keys tell React about the identity of each component which allows React to maintain state between re-renders. If a component’s key changes, the component will be destroyed and re-created with a new state.

    key is a special and reserved property in React (along with ref, a more advanced feature). When an element is created, React extracts the key property and stores the key directly on the returned element. Even though key may look like it belongs in propskey cannot be referenced using this.props.key. React automatically uses key to decide which components to update. A component cannot inquire about its key.

    It’s strongly recommended that you assign proper keys whenever you build dynamic lists. If you don’t have an appropriate key, you may want to consider restructuring your data so that you do.

    If no key is specified, React will present a warning and use the array index as a key by default. Using the array index as a key is problematic when trying to re-order a list’s items or inserting/removing list items. Explicitly passing key={i} silences the warning but has the same problems as array indices and is not recommended in most cases.

    Keys do not need to be globally unique; they only need to be unique between components and their siblings.

    Implementing Time Travel {#implementing-time-travel}

    In the tic-tac-toe game’s history, each past move has a unique ID associated with it: it’s the sequential number of the move. The moves are never re-ordered, deleted, or inserted in the middle, so it’s safe to use the move index as a key.

    In the Game component’s render method, we can add the key as 

  •  and React’s warning about keys should disappear:
        const moves = history.map((step, move) => {
          const desc = move ?
            'Go to move #' + move :
            'Go to game start';
          return (
  • ); });

    View the full code at this point

    Clicking any of the list item’s buttons throws an error because the jumpTo method is undefined. Before we implement jumpTo, we’ll add stepNumber to the Game component’s state to indicate which step we’re currently viewing.

    First, add stepNumber: 0 to the initial state in Game’s constructor:

    class Game extends React.Component {
      constructor(props) {
        super(props);
        this.state = {
          history: [{
            squares: Array(9).fill(null),
          }],
          stepNumber: 0,
          xIsNext: true,
        };
      }
    

    Next, we’ll define the jumpTo method in Game to update that stepNumber. We also set xIsNext to true if the number that we’re changing stepNumber to is even:

      handleClick(i) {
        // this method has not changed
      }
    
      jumpTo(step) {
        this.setState({
          stepNumber: step,
          xIsNext: (step % 2) === 0,
        });
      }
    
      render() {
        // this method has not changed
      }
    

    We will now make a few changes to the Game’s handleClick method which fires when you click on a square.

    The stepNumber state we’ve added reflects the move displayed to the user now. After we make a new move, we need to update stepNumber by adding stepNumber: history.length as part of the this.setState argument. This ensures we don’t get stuck showing the same move after a new one has been made.

    We will also replace reading this.state.history with this.state.history.slice(0, this.state.stepNumber + 1). This ensures that if we “go back in time” and then make a new move from that point, we throw away all the “future” history that would now become incorrect.

      handleClick(i) {
        const history = this.state.history.slice(0, this.state.stepNumber + 1);
        const current = history[history.length - 1];
        const squares = current.squares.slice();
        if (calculateWinner(squares) || squares[i]) {
          return;
        }
        squares[i] = this.state.xIsNext ? 'X' : 'O';
        this.setState({
          history: history.concat([{
            squares: squares
          }]),
          stepNumber: history.length,
          xIsNext: !this.state.xIsNext,
        });
      }
    

    Finally, we will modify the Game component’s render method from always rendering the last move to rendering the currently selected move according to stepNumber:

      render() {
        const history = this.state.history;
        const current = history[this.state.stepNumber];
        const winner = calculateWinner(current.squares);
    
        // the rest has not changed
    

    If we click on any step in the game’s history, the tic-tac-toe board should immediately update to show what the board looked like after that step occurred.

    View the full code at this point

    Wrapping Up {#wrapping-up}

    Congratulations! You’ve created a tic-tac-toe game that:

    • Lets you play tic-tac-toe,
    • Indicates when a player has won the game,
    • Stores a game’s history as a game progresses,
    • Allows players to review a game’s history and see previous versions of a game’s board.

    Nice work! We hope you now feel like you have a decent grasp on how React works.

    Check out the final result here: Final Result.

    If you have extra time or want to practice your new React skills, here are some ideas for improvements that you could make to the tic-tac-toe game which are listed in order of increasing difficulty:

    1. Display the location for each move in the format (col, row) in the move history list.
    2. Bold the currently selected item in the move list.
    3. Rewrite Board to use two loops to make the squares instead of hardcoding them.
    4. Add a toggle button that lets you sort the moves in either ascending or descending order.
    5. When someone wins, highlight the three squares that caused the win.
    6. When no one wins, display a message about the result being a draw.

    Throughout this tutorial, we touched on React concepts including elements, components, props, and state. For a more detailed explanation of each of these topics, check out the rest of the documentation. To learn more about defining components, check out the React.Component API reference.